Disable blank spaces in the Bootstrap modal box and click Close. bootstrap Modal
A Modal box is a child form that overwrites the parent form. Normally, the purpose is to display the content from a separate source. Some interactions can be made without leaving the parent form. Subforms provide information and interaction. By default, the modal box of bootstrap is closed when you click other blank areas (usually the mask layer). In this case, do not click other areas to close the modal box.
$ ('# Mymodal'). modal ({backdrop: 'static', keyboard: false });
Backdrop: static, the blank space is not closed.
When keyboard is set to false, the esc keyboard is not disabled.
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 custocustom-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"> × </span> </button>
Data-backdrop = "static" specifies a static background. When you click the outside of the modal box, the modal box is not closed. Data-keyboard is used to close the modal box when the escape key is pressed. If it is set to false, the key is invalid.
The above is all the content of this article. I hope it will be helpful for your learning and support for helping customers.