我使用Bootstrap
2.3.2,和我使用这样的模态对话框:可靠隐藏引导模式
<div id="notice1" class="modal hide fade">
<div class="modal-body">
<h4>This is a dialog for user...</h4>
</div>
...
</div>
和
var notice1 = $("#notice1");
notice1.modal({
keyboard: false,
backdrop: "static",
show: false
});
// Show the dialog
notice1.modal("show");
// Close the dialog
notice1.modal("hide");
大部分的时间,上述工程罚款和模式对话框打开和编程关闭。但是,在极少数情况下,尽管黑暗的背景被删除,但调用.modal("hide")
根本不会关闭对话框。
这是一个巨大的潜在问题,因为对话框可能卡在屏幕上并阻止部分内容。
在调用.modal("hide")
之后,是否有可靠的方法来确保对话框总是关闭?或者更好的是,我们如何确保Bootstrap
的一致hide
行为?我不想完全从DOM中删除对话框,因为同一个对话框可能会在页面上重新使用。