Javascript 默认情况下,在加载页面上显示模式,并且不关闭模式
我有JS中的下一个脚本,我想在加载页面上用.Modal('show')打开Modal,但我也希望这个Modal不会在单击时关闭。我在Internet上看到过.modal({background:'static',keyboard:false})但是这两个东西结合在一起不起作用,我得到的唯一结果是显示modal,但当我点击它时它关闭了 我的按钮模式:Javascript 默认情况下,在加载页面上显示模式,并且不关闭模式,javascript,html,jquery,bootstrap-4,bootstrap-modal,Javascript,Html,Jquery,Bootstrap 4,Bootstrap Modal,我有JS中的下一个脚本,我想在加载页面上用.Modal('show')打开Modal,但我也希望这个Modal不会在单击时关闭。我在Internet上看到过.modal({background:'static',keyboard:false})但是这两个东西结合在一起不起作用,我得到的唯一结果是显示modal,但当我点击它时它关闭了 我的按钮模式: <button type="button" class="btn btn-primary show-modal&
<button type="button" class="btn btn-primary show-modal" data-keyboard="false" data-backdrop="static" data-toggle="modal" data-target="#ambitModal">
Launch demo modal
</button>
试着用这种方法
$('#ambitModal').modal({
show: true,
backdrop: 'static',
keyboard: false
})
Or
$('#ambitModal').modal({
show: true, { backdrop: 'static', keyboard: false }
})
阿里加图!它对我有用
$('#ambitModal').modal({
show: true,
backdrop: 'static',
keyboard: false
})
Or
$('#ambitModal').modal({
show: true, { backdrop: 'static', keyboard: false }
})