在我将显示模式切换为手动之前,我的模式工作正常。我使用以下简化的 javascript 代码调用模态:
var dlg = $('#loginDlg');
dlg.modal({show:false});
if(loggedIn) {
logout();
} else {
dlg.modal('show');
}
我使用 bootstrap 作为 meteor 插件,所以只包含 bootstrap.js
。
我的标记:
<button type="button" class="btn btn-large span1" id="login" role="button"
data-toggle="modal" data-target="#loginDlg">
<i class="icon-off pull-right"></i>
</button>
<div class="modal hide fade" id="loginDlg" tabindex="-1"
role="dialog" aria-labelledby="loginDlgLabel" aria-hidden="true">
---
</div>
也许我必须更改标记?
编辑:
解决方案:我必须删除按钮标记中的 data-target
属性!使用此属性,bootstrap 会切换模式两次。
最佳答案
解决方案:我必须删除按钮标记中的 data-target
属性!使用此属性,bootstrap 会切换模式两次。
关于javascript - Twitter Bootstrap 模式淡入并在手动切换半秒后消失,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14741870/