我正在做一个bootstrap网站,与一对bootstrap 'Modals'。 我正在尝试自定义一些默认功能。
问题在于; 你可以通过点击背景来关闭模式。 有没有办法禁用这个功能? 只在特定的情态动词?
引导模态页面
我正在做一个bootstrap网站,与一对bootstrap 'Modals'。 我正在尝试自定义一些默认功能。
问题在于; 你可以通过点击背景来关闭模式。 有没有办法禁用这个功能? 只在特定的情态动词?
引导模态页面
当前回答
我缺少情态对话框,这就是为什么我的关闭情态不能正常工作。
其他回答
试试这个:
<div
class="modal fade"
id="customer_bill_gen"
data-keyboard="false"
data-backdrop="static"
>
你可以使用
$.fn.modal.prototype.constructor.Constructor.DEFAULTS.backdrop = 'static';
$.fn.modal.prototype.constructor.Constructor.DEFAULTS.keyboard = false;
更改默认行为。
你也可以不使用JQuery做到这一点,如下所示:
<div id="myModal">
var modal = document.getElementById('myModal');
modal.backdrop = "static";
modal.keyboard = false;
这些方法对我来说都没用。
我有一个条款和条件模式,我想强迫人们在继续之前审查…默认的“静态”和“键盘”选项使它不可能向下滚动页面,因为条款和条件是几页日志,静态不是我的答案。
因此,我去解除模式上的点击方法的绑定,与以下我能够得到想要的效果。
$('.modal').off('click');
根据你想要的屏幕宽度添加下面的css。
@media (min-width: 991px){
.modal-dialog {
margin: 0px 179px !important;
}
}