jschr/bootstrap-modal hiện có 5.0k sao trên GitHub, viết chủ yếu bằng JavaScript. Extends the default Bootstrap Modal class. Responsive, stackable, ajax and more.
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
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.cssbefore 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:
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:
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.
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/jschr/bootstrap-modal là nguồn chính thức.
jschr/bootstrap-modal có những chủ đề gì?
GitHub topics của jschr/bootstrap-modal: "bootstrap", "bootstrap-modal", "modal", "modalmanager". TopGit xếp repo vào nhóm mã nguồn mở.
jschr/bootstrap-modal có phải mã nguồn mở không?
Có — jschr/bootstrap-modal phát hành theo license Apache-2.0, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/jschr/bootstrap-modal.
jschr/bootstrap-modal có trang demo không?
Dự án có trang chủ ở http://jschr.github.io/bootstrap-modal/. Tab "Readme" ở trang này thường có ảnh chụp và hướng dẫn bắt đầu nhanh.
jschr/bootstrap-modal còn đang phát triển không?
Commit gần nhất trên jschr/bootstrap-modal là 7.6 năm trước (theo timestamp GitHub). Repo có 1.1k fork — một chỉ báo về mức độ quan tâm của cộng đồng.
jschr/bootstrap-modal dùng license gì?
jschr/bootstrap-modal phát hành theo license Apache-2.0. Nên mở file LICENSE trên GitHub để xác nhận — license metadata đôi khi lệch với thực tế dự án.
Đọc đầy đủ README ở tab phía trên.
Chưa chắc bootstrap-modal có hợp với bạn?
Để ChatGPT, Claude hoặc Perplexity tìm hiểu giúp — bấm bên dưới và xem AI nói gì về bootstrap-modal.