All Projects → jschr → Bootstrap Modal

jschr / Bootstrap Modal

Licence: apache-2.0
Extends the default Bootstrap Modal class. Responsive, stackable, ajax and more.

Programming Languages

javascript
184084 projects - #8 most used programming language
CSS
56736 projects

Projects that are alternatives of or similar to Bootstrap Modal

Ng2 Bootstrap Modal
Library to simplify the work with bootstrap modal dialogs
Stars: ✭ 53 (-98.95%)
Mutual labels:  modal, bootstrap
Bootstrap Show Modal
A Bootstrap 4 / jQuery plugin wrapper, to create modals dynamically in JavaScript
Stars: ✭ 38 (-99.25%)
Mutual labels:  modal, bootstrap
Ng Bootstrap
Angular powered Bootstrap
Stars: ✭ 7,872 (+56.22%)
Mutual labels:  modal, bootstrap
Bootstrap4 Fs Modal
A simple way to improve UX of Bootstrap 4 modals on mobile phones.
Stars: ✭ 102 (-97.98%)
Mutual labels:  modal, bootstrap
Lightbox
A lightbox gallery plugin for Bootstrap
Stars: ✭ 1,866 (-62.97%)
Mutual labels:  modal, bootstrap
Bdialog
Extend the Bootstrap Modal features, making dialog more functions and easier to use, dialog type including modal, alert, mask and toast types
Stars: ✭ 174 (-96.55%)
Mutual labels:  modal, bootstrap
Ax5ui Kernel
Javascript UI Framework - AX5UI - Kernel Module
Stars: ✭ 164 (-96.75%)
Mutual labels:  modal, bootstrap
bootstrap-modal-wrapper
Bootstrap modal factory that supports dynamic modal creations and nested stacked modal features.
Stars: ✭ 18 (-99.64%)
Mutual labels:  modal, bootstrap-modal
Awesome React Bootstrap Components
⚛️ React.js components made using 🅱️ Bootstrap
Stars: ✭ 490 (-90.28%)
Mutual labels:  bootstrap
Gae Init
Google App Engine based on Python, Flask, RESTful, Bootstrap and tons of other cool features
Stars: ✭ 533 (-89.42%)
Mutual labels:  bootstrap
Bootstrap Vertical Tabs
Missing vertical tabs component for bootstrap.
Stars: ✭ 489 (-90.3%)
Mutual labels:  bootstrap
Twitter Bootstrap Rails
Twitter Bootstrap for Rails 6.0, Rails 5 - Rails 4.x Asset Pipeline
Stars: ✭ 4,518 (-10.34%)
Mutual labels:  bootstrap
Sveltestrap
Bootstrap 4 components for Svelte
Stars: ✭ 536 (-89.36%)
Mutual labels:  bootstrap
Guns Lite
基于spring boot脚手架项目,spring data jpa+Spring Boot2+bootstrap完整的后台管理系统
Stars: ✭ 491 (-90.26%)
Mutual labels:  bootstrap
Angular Ui Notification
Angular.js service providing simple notifications using Bootstrap 3 styles with css transitions for animating
Stars: ✭ 549 (-89.1%)
Mutual labels:  bootstrap
Sing App Vue Dashboard
Vue.js admin dashboard template built with Bootstrap 4.5
Stars: ✭ 482 (-90.43%)
Mutual labels:  bootstrap
Responsiveframework
Easily make Flutter apps responsive. Automatically adapt UI to different screen sizes. Responsiveness made simple. Demo: https://gallery.codelessly.com/flutterwebsites/minimal/
Stars: ✭ 476 (-90.55%)
Mutual labels:  bootstrap
Bootstrap Fileinput
An enhanced HTML 5 file input for Bootstrap 5.x/4.x./3.x with file preview, multiple selection, and more features.
Stars: ✭ 5,097 (+1.15%)
Mutual labels:  bootstrap
Tabler
Tabler is free and open-source HTML Dashboard UI Kit built on Bootstrap
Stars: ✭ 24,611 (+388.41%)
Mutual labels:  bootstrap
Fontawesome Iconpicker
Font Awesome Icon Picker component for Bootstrap.
Stars: ✭ 519 (-89.7%)
Mutual labels:  bootstrap

Note: Since this plugin was created to solve a lot of the issues with BS2, it still uses the BS2 markup syntax. Currently I believe the default BS3 modal addresses some of the bigger issues and is not worth maintaining two versions of this plugin.

Bootstrap Modal v2.2.6

See live demo here.

Extends Bootstrap's native modals to provide additional functionality. Introduces a ModalManager class that operates behind the scenes to handle multiple modals by listening on their events.

A single ModalManager is created by default on body and can be accessed through the jQuery plugin interface.

    $('body').modalmanager('loading');

Bootstrap-Modal can be used as a replacement for Bootstrap's Modal class or as a patch to the library.

Bootstrap 3

If you're using BS3, I've provided a compatible css patch. Include bootstrap-modal-bs3patch.css before the main bootstrap-modal.css file to use this plugin with Bootstrap 3.

If you're using the loading spinner functionality you may also need to change the default template to be compatible in js:

    $.fn.modal.defaults.spinner = $.fn.modalmanager.defaults.spinner = 
        '<div class="loading-spinner" style="width: 200px; margin-left: -100px;">' +
            '<div class="progress progress-striped active">' +
                '<div class="progress-bar" style="width: 100%;"></div>' +
            '</div>' +
        '</div>';

Overview

  • Backwards compatible
  • Responsive
  • Stackable
  • Full width
  • Load content via AJAX
  • Disable background scrolling

Installation

  • Include css/bootstrap-modal.css after the main bootstrap css files.
  • Include js/bootstrap-modalmanager.js and js/bootstrap-modal.js after the main bootstrap js files.
	<link href="css/bootstrap.css" rel="stylesheet" />
	<link href="css/bootstrap-responsive.css" rel="stylesheet" />
 	<link href="css/bootstrap-modal.css" rel="stylesheet" />

 	<script src="js/bootstrap.js"></script>
 	<script src="js/bootstrap-modalmanager.js"></script>
 	<script src="js/bootstrap-modal.js"></script>

Options

In addition to the standard bootstrap options, you now have access to the following options

Modal

  • width Set the initial width of the modal.

  • height Set the initial height of the modal.

  • maxHeight Set the max-height of the modal-body.

  • loading Toggle the loading state.

  • spinner Provide a custom image or animation for the loading spinner.

  • backdropTemplate Provide a custom modal backdrop.

  • consumeTab Used to enable tabindexing for modals with data-tabindex. This is set to true by default.

  • focusOn The element or selector to set the focus to once the modal is shown.

  • replace If set to true, the modal will replace the topmost modal when opened.

  • attentionAnimation Set the animation used by the attention method. Any animation in animate.css is supported but only the shake animation is included by default.

  • modalOverflow Set this property to true for modals with highly dynamic content. This will force the modal to behave as if it is larger than the viewport.

  • manager Set the modal's manager. By default this is set to the GlobalModalManager and will most likely not need to be overridden.

ModalManager

  • loading Toggle the loading state.

  • backdropLimit Limit the amount of backdrops that will appear on the page at the same time.

  • spinner Provide a custom image or animation for the loading spinner.

  • backdropTemplate Provide a custom modalmanager backdrop. This backdrop is used when $element.modalmanager('loading') is called.

Getting a reference to the modal manager

If you did not created your own ModalManager, perhaps you'll need a reference to it. That can be easily accomplished using the following snippet:

	var modalManager = $("body").data("modalmanager");
	var openModals = modalManager.getOpenModals();
	modalManager.removeLoading();

After that, you'll be able to call any methods that modal manager has, such as:

  • removeLoading (remove the loading and backdrop window);
  • getOpenModals (to get the modals that are already open);
  • etc;

Disable Background Scrolling

If you want to prevent the background page from scrolling (see demo for example) you must wrap the page contents in a <div class="page-container">. For example:

	<body>
	   <div class="page-container">
		  <div class="navbar navbar-fixed-top">...</div>
		  <div class="container">...</div>
	   </div>
	</body>

The reason for doing this instead of just simply setting overflow: hidden when a modal is open is to avoid having the page shift as a result of the scrollbar appearing/disappearing. This also allows the document to be scrollable when there is a tall modal but only to the height of the modal, not the entire page.

Constrain Modal to Window Size

You can bind the height of the modal body to the window with something like this:

    $.fn.modal.defaults.maxHeight = function(){
        // subtract the height of the modal header and footer
        return $(window).height() - 165; 
    }

Note: This will be overwritten by the responsiveness and is only set when the modal is displayed, not when the window is resized.

Tab Index for Modal Forms

You can use data-tabindex instead of the default tabindex to specify the tabindex within a modal.

    <input type="text" data-tabindex="1" />
    <input type="text" data-tabindex="2" />

See the stackable example on the demo page for an example.

Bitdeli Badge

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].