Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

bootstrap css - how to make a modal dialog modal without affecting the background

In bootstrap css, it is possible to display a modal dialog, but I want to be able to make it modal so the UI behind doesn't respond, without having the dark black background shown.

There seems to be no options that allow me to do this on the $("#selector").modal() function.

like image 662
jaffa Avatar asked Nov 17 '11 14:11

jaffa


People also ask

How do I disable modal backdrop?

On Options chapter, in the page you linked, you can see the backdrop option. Passing this option with value 'static' will prevent closing the modal. As @PedroVagner pointed on comments, you also can pass {keyboard: false} to prevent closing the modal by pressing Esc .

How do I stop Bootstrap modal from hiding when clicking outside?

Data-keyword="false" is to prevent closing modal while clicking Esc button, while data-backdrop="static" , allows you keep modal pop-up opened when clicking on Gray area.

What is backdrop static in modal?

The backdrop option specifies whether the modal should have a dark overlay (the background color of the current page) or not.

Is Bootstrap modal responsive?

Bootstrap modals are supposed to be responsive by default. Something to look out for is if you have a width set on your Modal.


1 Answers

add data-backdrop="false" to <div class="modal"> and Bootstrap will do the rest.

Example:

<div class="modal" id="genericModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" data-backdrop="false"> 
like image 179
Alex Marple Avatar answered Oct 07 '22 02:10

Alex Marple