2013-07-03 54 views
-2

我只是在bootstrap網站上覆制和粘貼模式示例,並且它不工作,我該怎麼辦?就像當我點擊按鈕時,它沒有打開。 啓動演示模式如何在bootstrap中創建模態?

<!-- Modal --> 
<a href="#myModal" role="button" class="btn" data-toggle="modal">Launch demo modal</a> 
<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> 

+2

Wha t不工作,到目前爲止你有什麼代碼? – Styphon

+0

對不起,我以爲我寫了..現在它在那裏 –

回答

1

您可以在這裏找到Bootstrap modalBootstrap Examples

$('#myModal').modal('show')所有信息會顯示您的模式

你可以使用id = BTN添加一個按鈕,並做到這一點:

$(document).ready(function() { 

$('#Btn').live("click", function() { 

$("#modal").modal("show"); 

}); 

});