2013-06-25 39 views
0

我正在使用Bootstrap佈局我的網頁,並在某些地方使用模式框。 現在當我點擊一個鏈接時,它會打開一個確認模式框,至少它是假設的。 但是,如果窗口太寬(〜> 700像素),它只會顯示模式對話框的一部分:模式框不顯示完全

enter image description here

如果窗口足夠小(可能與響應),它會顯示整個屏幕。

這是我如何實現模態框。

<a class="confirm-delete" data-id=someValue role="button"><i class="icon-trash"></i></a> 

$('.confirm-delete').click(function(e) {     
    e.preventDefault();         
    var id = $(this).data('id');       
    $('#deleteConfirmation').data('id', id).modal('show');                
}); 

$('#deleteConfirmation').bind('show', function() { 
    var id = $(this).data('id');       
}); 

這裏是CSS和腳本包括我的一部分:

<link rel="stylesheet" href="${cherrypy.url('/asset/css/bootstrap.css')}" media="screen" /> 
<link rel="stylesheet" href="${cherrypy.url('/asset/css/glyphicons.css')}" media="screen" /> 
<link rel="stylesheet" href="${cherrypy.url('/asset/css/datepicker.css')}" media="screen" /> 
<link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/css/bootstrap-combined.min.css" rel="stylesheet"> 
<link rel="stylesheet" href="${cherrypy.url('/asset/css/modified-bootstrap-responsive.min.css')}" media="screen" /> 
<link rel="stylesheet" href="http://code.jquery.com/ui/1.9.2/themes/base/jquery-ui.css" type="text/css" /> 

任何想法可能是對不能完全顯示模式對話框的原因是什麼?對不起,我無法在小提琴中重現問題,也無法提供實況網站。

<script src="http://code.jquery.com/jquery-1.8.3.js" type="text/javascript"></script>        
<script src="http://code.jquery.com/ui/1.9.2/jquery-ui.js" type="text/javascript"></script>       
<script src="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/js/bootstrap.min.js"></script>      
<script src="${cherrypy.url('/asset/js/bootstrap-datepicker.js')}"></script> 

編輯: 我沒有HTML頁面上太多的內容。只需一個按鈕和確認框。

這是頁面的結構:

<%! import cherrypy %> 
<!DOCTYPE html> 
<html> 
<head> 
    <%include file="header.mako"/> 
</head> 
    <!-- Piwik Tracking Code --> 
<body> 
<%include file="navigation.mako"/> 
    <div class="container"> 
     <p> 
      ${self.body()} 
     </p> 
    </div> 
    </body> 
</html> 

header.mako由樣式表我張貼以上和${self.body()}被確認對話框和JS(上面貼):

<div class="modal hide fade" id="deleteConfirmation" tabindex="-1" role="dialog" aria-hidden="true"> 
    <div class="modal-header"> 
     <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button 
     <h3>Confirmation</h3> 
    </div> 
    <div class="modal-body"><p class="error-text">Sure?</p> 
    </div> 
    <div class="modal-footer"> 
     <button class="btn" data-dismiss="modal" aria-hidden="true">Cancel</button><a href="${cherrypy.url('email=')}" class="btn btn-danger">Delete</a> 
    </div> 
</div> 
+0

你可以張貼一些HTML的身體的?特別是你的內容的包裝。試圖複製,它可能與類有關。 – JasonM

+0

@JasonM我更新了我的初始帖子。但是,內容並不多。我猜這個問題是在CSS文件中的某處... – cherrun

+0

我的猜測是它在修改後的響應引導文件中。如果你不包括它是否工作,或者你有相同的問題? – JasonM

回答

1

看起來像此行:

<link rel="stylesheet" href="${cherrypy.url('/asset/css/bootstrap.css')}" media="screen" /> 

與梳子相沖突獨立非執行董事的引導文件從CDN來:

<link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/css/bootstrap-combined.min.css" rel="stylesheet"> 

只是刪除從資產未來的bootstrap.css鏈接,你應該是不錯的。

注意:這是從評論衍生 - 只是把這裏的情況發生了這種事情誰都