2013-06-25 82 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链接,你应该是不错的。

注意:这是从评论衍生 - 只是把这里的情况发生了这种事情谁都