Bootstrap:Twitter Bootstrap Modal在页面加载时不会隐藏

use*_*958 1 javascript modal-dialog twitter-bootstrap

我从给出的示例中复制了完全相同的代码:

<-- Button to trigger modal -->
<a href="#myModal" role="button" class="btn" data-toggle="modal">Launch demo modal</a>

<-- Modal -->
<div class="modal" id="myModal" 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)

http://twitter.github.com/bootstrap/javascript.html#modals
Run Code Online (Sandbox Code Playgroud)

当页面首次加载时,模态立即出现.我没有javascript来触发它.他们网站上的现场演示不是这样的.有什么遗失?

Ada*_*ant 6

hide类添加到模态中.

更新在B3中,模态已经完全修改.你不应该需要这门课.

如果仍然显示,请确保您在HTML中使用正确的语法.它应该默认隐藏.