Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

twitter bootstrap modal not really modal

Is there an option in the bootstrap modal to make it stay modal even if the user clicks away from the modal? The modal dialog hides when the user click outside the dialog. I would like it to stay modal until the user clicks the close button.

like image 808
Arcadian Avatar asked Apr 19 '12 04:04

Arcadian


People also ask

How can I modify Bootstrap modal?

Bootstrap 4 ModalChange the size of the modal by adding the . modal-sm class for small modals, . modal-lg class for large modals, or . modal-xl for extra large modals.

What is popover modal?

About Modal Popovers Modals provide a nice way to provide extra details without navigating away from the page completely, but they hide your current context and feel a bit 90's. Popovers are essentially stylish tooltips which provide a little extra information without losing context.

How do I turn off Bootstrap 4 modal?

Clicking on the modal “backdrop” will automatically close the modal. Bootstrap only supports one modal window at a time.


2 Answers

From the docs: http://getbootstrap.com/javascript/#modals

Specify a static backdrop option

$("#yourModal").modal({"backdrop": "static"});
like image 134
Mengdi Gao Avatar answered Sep 22 '22 17:09

Mengdi Gao


Add the attribute data-backdrop="static" to your modal div like so:

<div id="someModal" class="modal hide" data-backdrop="static">
    <div class="modal-header">
        ...
    </div>
    <div class="modal-body">
        ...
    </div>
</div>
like image 41
pav Avatar answered Sep 22 '22 17:09

pav