2014-03-28 106 views
0

我正在尋找使用twitter引導模式功能。因此,我已將複製粘貼到文檔中幷包含所有文件。但每次我點擊我的按鈕沒有出現,我不知道爲什麼:Twitter Bootstrap模式 - 不顯示

<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
    <title>Testing</title> 

    <link rel="stylesheet" type="text/css" href="css/bootstrap-theme.css"> 
    <link rel="stylesheet" type="text/css" href="css/bootstrap.css"> 
    <script src="js/jquery-1.10.2.js"></script> 
    <script type="js/bootstrap.js"></script> 
</head> 
<body style="background:#bf9d93;"> 

    <!-- Button trigger modal --> 
<button class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal" > 
    Launch demo modal 
</button> 

<!-- Modal --> 
<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">&times;</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> 

現在根據文檔,在使用部分允許我簡單地通過數據使用上面的代碼,並調用模式屬性。因此,這是使用元素我的第一次,所以我敢肯定它我有過一個愚蠢的事情看,但我不能看到它是什麼......

+1

在你的代碼中有:''應該是'' – ajtrichards

回答

3

檢查代碼的第8行。您有:

<script type="js/bootstrap.js"></script>

相反的:

<script src="js/bootstrap.js"></script>

不正確加載的文件bootstrap.js它不會工作。

+0

aaaaaaa !!謝謝!我知道這是一個愚蠢的錯誤,非常感謝你,我花了幾個小時才找到這個愚蠢的錯誤 – user481610

-1

在點擊事件調用:

$('#myModal).modal({ show: true }); 
+1

模式應該沒有這個代碼。 – ajtrichards

+0

耶你的權利 –