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.
If you opening the modal by js use:
$('#myModal').modal({backdrop: 'static', keyboard: false})
If you are using data attributes, use:
<button data-target="#myModal" data-toggle="modal" data-backdrop="static" data-keyboard="false">
Launch demo modal
</button>`
原文:http://stackoverflow.com/a/22208662/602382
转自:Disable click outside of bootstrap model area to close modal
本文介绍如何在Bootstrap中禁用模态框的点击外部区域关闭功能,通过设置`backdrop`为'static'和`keyboard`为'false'来实现。同时提供了使用JavaScript和数据属性两种方式的示例。

被折叠的 条评论
为什么被折叠?



