【发布时间】:2013-02-16 23:40:44
【问题描述】:
我创建了一个模态对话
<a href="#myModal" role="button" class="btn" data-toggle="modal" id="LaunchDemo">Launch demo modal</a>
<!-- Modal -->
<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>
我刚刚从..调用了模态。
$("a#LaunchDemo").click();
但是屏幕上的模态只是blinking,我也通过按钮单击调用了模态。我遇到了同样的问题,我哪里出错了?,请帮助..
【问题讨论】:
-
$('#myModal').modal('show');它奏效了
-
确保在结束正文标记之前的页面底部加载 Bootstrap.js。如果你这样做了,你就不需要写一行JS了。
标签: javascript jquery twitter-bootstrap modal-dialog