如何禁用模态主体关闭,请注意我不能使用模态类或模态淡入淡出。 我正在起诉两个页面,一个页面有一个 href,然后单击转到另一个页面有模态:
<td align='center' span style="font-weight:bold;"><a href="save_new.php</a></td>
所以这是我的代码
<link rel="stylesheet" href="css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('#myModal').modal({
backdrop: 'static'
});
});
</script>
<div id="myModal" class="modal-body">
<button class = "btn btn-success" ><span class = "glyphicon glyphicon-ok"></span> Done</button>
</div>
最佳答案
作为 Javascript:
$('#modal').modal({
backdrop: 'static',
keyboard: false
})
作为 HTML:
<a data-backdrop="static" data-keyboard="false" href="#">
关于jquery - Bootstrap modal-body – 禁止使用 ESC 键或鼠标关闭,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41966854/