这是我打算运行的代码:the second example of Modals
但即使是在jsfiddle,它也不起作用:link
<!-- Button to trigger modal -->
<a href="#myModal" role="button" class="btn" data-toggle="modal">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 class="modal-footer">
<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
<button class="btn btn-primary">Save changes</button>
</div>
</div>
答案 0 :(得分:3)
除了您已经引用的bootstrap.js
文件之外,您缺少对bootstrap.min.js
或bootstrap.min.css
的引用。
查看此更新后的工作小提琴http://jsfiddle.net/cKH8X/2/