When developing a project, a popup is often needed, and many frames have their own pop-up boxes, which compare the current popular bootstrap with modal frames.
Most of the time this thing is very convenient to use, you can save a lot of time for the development of their own definition! Bootstrap is also used in recent projects, as well as its modal frame model. It's really cool to use, just $ ("#popbox"). Model ("show"). But the cool, the bug also comes!
The reason is that I need to define some events and methods and some variables in the popup box! However, when I click on an element to make a change in a variable, the user accidentally pressed the ESC, the tragedy occurred, the value of the variable because you have just been clicked to produce a variable, but the fact does not produce interaction, but the popup box has been ESC off!
That makes the subsequent operation produced a bug, have to refresh the page to return to normal! Obviously, the ESC operation most of the situation is wrong operation, but, since the discovery of the bug, it is necessary to find ways to avoid it! Fortunately, the development of Bootstrap has already predicted the relevant situation! only need
$ ("#popbox"). Model ({show:true, keyboard:false}), yes, disable the keyboard from manipulating the modal frame! This way, even if you press ESC with the power of your breast, it won't turn off!
Bootstrap modal box Esc key does not close