The Modal Box (Modal) is a subform that is overwritten on the parent form. Typically, the intent is to display content from a single source, and you can interact without leaving the parent form. subforms provide information, interactivity, and so on. Bootstrap modal box by default, the Modal box is closed by clicking on other blank areas (usually the mask layer), and the following methods are prohibited from clicking on other areas to close the modal box.
$ (' #myModal '). Modal ({backdrop: ' Static ', keyboard:false});
When backdrop:static, the blank space does not close.
The ESC keyboard does not close when Keyboard:false.
The above code is also used to open the modal box.
You can also use the following methods:
<div class= "modal" id= "Mymodal" tabindex= "-1" role= "dialog" aria-labelledby= "Mymodallabel" aria-hidden= "true" data-backdrop= "Static" data-keyboard= "false" >
<div class= "Modal-dialog custom-dialog succ-dialog" >
<div class= "modal-content" >
<div class= "Modal-header" >
<button type= "button" class= " Close ' data-dismiss= ' modal ' aria-label= ' close ' ><span aria-hidden= ' true ' >x</span></button>
The data-backdrop= "Static" here specifies a static background that does not close the modal box when the user clicks outside the modal box. The data-keyboard refers to when the escape key is pressed to close the modal box, when set to False, the key is invalid.
If you want to further study, you can click here to learn, and then attach 3 wonderful topics:
Bootstrap Learning Course
Bootstrap Practical Course
Bootstrap Plugin Usage Tutorial
The above is the entire content of this article, I hope to help you learn, but also hope that we support the cloud habitat community.