【发布时间】:2014-05-22 08:22:21
【问题描述】:
当我尝试在我的代码中使用Bootstrap Modal 时遇到了一些问题。
HTML:
<a href="http://another.page" data-toggle="modal">Another Page</a>
或
<a href="http://another.page" data-toggle="modal" data-target="#myModal">Another Page</a>
我想将another.page 模态到我的页面,但它不起作用。
another.page 看起来像:
<html>
<body>
<div id="myModal" class="tm-modal hide fade" tabindex="-1" role="dialog" aria- labelledby="myModalLabel" aria-hidden="true">
<div class="tm-modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"> </button>
<h6>Modal Heading</h6>
</div>
<div class="tm-modal-body">
<p>One fine body
<85>
</p>
</div>
<div class="tm-modal-footer">
<button class="tm-btn" data-dismiss="modal" aria-hidden="true">Close</button>
<button class="tm-btn tm-btn-recommand">Save changes</button>
</div>
</div>
</body>
</html>
我不想在我的代码中将another.page 加载为<div>,因为我需要使用模态的地方太多了。
我错过了什么重要的事情吗?
非常感谢。
【问题讨论】:
-
试试this answer。它对我有用。
标签: jquery twitter-bootstrap modal-dialog