2014-02-20 56 views
0

在軌道4,5的應用程序,我打電話與模態使用引導3:引導模式得到推到右邊

<a href="#myModal" data-target="#myModal" role="button" data-toggle="modal"><span class="glyphicon glyphicon-plus"></span> New Listing</a> 

    <!-- 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">Hey, wait a second!</h4> 
      </div> 
      <div class="modal-body"> 
      In order to blah blah...! 
      </div> 
      <div class="modal-footer"> 
      <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button> 
      <%= link_to "Sign Out", destroy_user_session_path, type: "button" , class: "btn btn-primary" , method: :delete %> 
      </div> 
     </div><!-- /.modal-content --> 
     </div><!-- /.modal-dialog --> 
    </div><!-- /.modal --> 

一切運作良好,當我的模式執行,它推離正確的,除了屏幕: enter image description here

我的模態CSS是:

.modal { 
    position: fixed; 
    top: 0; 
    right: 0; 
    bottom: 0; 
    left: 0; 
    z-index: 1040; 
    display: none; 
    overflow: auto; 
    overflow-y: scroll; 
} 

我試圖改變位置,絕對的,但這並不解決問題。

任何recs?

+0

你的網格佈局是如何構成的?你能檢查它是否正確?我認爲有可能是錯誤的,弄亂你的模式框,導致其代碼似乎是正確的 – sissy

+0

不知道,如果我完全理解。我使用這種模式(並有問題)的地方之一是在導航欄中。這不應該受到網格佈局的影響,對嗎? – dmt2989

+0

還有navbar是在網格佈局裏面,試着檢查一下;否則你可能會重新定義一些共享類。似乎奇怪的行爲 – sissy

回答

0

原來這是一個CSS問題。我使用Bootswatch的bootstrap主題。在使用標準引導代碼覆蓋Bootswatch的模態CSS元素之後,所有代碼都已修復。謝謝。