2014-10-09 62 views
-2

我的twitter引導模態窗口無法正確加載;它在加載時會褪色。 Here is an image demonstrating the problem嘰嘰喳喳bootstrap 3 ++模式窗口不加載

我已經嘗試了一些東西,但無法解決問題。

我的代碼是:

<button type=\"button\" class=\"btn btn-danger btn-mini\" data-toggle=\"modal\" data-target=\"#myModal\" href=\"#myModal\"> 

<div id=\"myModal\" class=\"modal fade\"> 
     <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\">Confirmation</h4> 
       </div> 
       <div class=\"modal-body\"> 
        <p>Do you want to save changes you made to document before closing?</p> 
        <p class=\"text-warning\"><small>If you don't save, your changes will be lost.</small></p> 
       </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></div> 
+1

您不能在'

+0

你在瀏覽器的控制檯中看到什麼錯誤? (F12按鈕)。此外,爲什麼你所有的報價都逃脫了? – 2014-10-09 19:14:54

回答

1

有無效的語法在你的代碼示例(HTML和Bootstrap)。看起來你正試圖在模態之前加載一個警告按鈕,但是你缺少按鈕的文本以及關閉按鈕標籤。這裏有一個Bootstrap 3的例子,它應該能夠完成你所描述的內容:

<button class="btn btn-danger btn-xs" data-toggle="modal" data-target="#myModal" href="#myModal"> 
    Save Now! 
</button> 
<div id="myModal" class="modal fade"> 
     <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">Confirmation</h4> 
       </div> 
       <div class="modal-body"> 
        <p>Do you want to save changes you made to document before closing?</p> 
        <p class="text-warning"><small>If you don't save, your changes will be lost.</small></p> 
       </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> 

編輯按鈕文本以閱讀你想要的內容。 「現在保存!」僅僅是用於說明目的的一個例子。