Nec*_*ro. 3 jquery twitter-bootstrap
我正在使用Twitter Bootstrap的Modal插件,它一切正常,控制台显示没有javascript错误,但我的问题是它在页面加载时打开?我关闭模态,然后可以重新打开它没有问题,但它只是在我重新加载页面时保持打开.这是我的标记
HTML 启动模式
<div id="myModal" class="modal hide fade" tabindex="-1" role="dialog" aria- labelledby="myModalLabel" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="myModalLabel">Modal header</h3>
</div>
<div class="modal-body">
<p>One fine body…</p>
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
<button class="btn btn-primary">Save changes</button>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
使用Javascript
非常简单:P,
<script>
$('#myModal').modal()
</script>
Run Code Online (Sandbox Code Playgroud)
$('#myModal').modal('hide')
Run Code Online (Sandbox Code Playgroud)
试试这个
http://twitter.github.com/bootstrap/javascript.html#modals