我想創建一個簡單的模式彈出使用Bootstrap。我從http://getbootstrap.com/javascript/#modals得到了樣品,我的代碼看起來是這樣的..Bootstrap模式彈出不顯示
<html>
<head>
<script src="js/jquery.js"></script>
<script src="js/bootstrap.js"></script>
<script src="js/bootstrap-modal.js"></script>
<link rel="stylesheet" href="css/bootstrap.css" />
</head>
<body>
<button class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal">
Launch demo modal
</button>
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title" id="myModalLabel">Modal title</h4>
</div>
<div class="modal-body">
...
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Save changes</button>
</div>
</div>
</div>
</div>
</body>
</html>
當我在我的瀏覽器上運行,然後按一下按鈕,在彈出的只顯示以毫秒爲單位,然後關閉again..how阻止彈出從那樣的關閉?
看起來像是回答了,但作爲一個附註,您應該在關閉'body'標記之前加載腳本。當他們在這樣的頭部時,他們會減慢頁面渲染速度。 –