我有一个简单的jquery弹出窗口,它必须将overflow设置为auto,因为结果列表可能会很长。滚动条显示得很好,但是关闭的图像被推到垂直滚动条和简单模式边框的后面。如果我注释掉
overflow: 'auto',关闭的图像在边框的顶部显示得很好。我尝试将图像的z索引设置得非常高,但没有任何效果。它还使水平滚动条显示,因为关闭的图像在垂直滚动条后面。
我的jquery代码是
jQuery('#CustLookupResults').modal({
containerCss: {
padding: 0,
overflow: 'auto',
maxHeight: 800
},
onShow: function (dlg) {
$(dlg.container).css('width', 650);
$(dlg.container).css('height', 'auto');
},
overlayClose: true,
opacity: 75
});我的css是
#simplemodal-container
{
border:8px solid;
padding: 12px;
border-color:Black;
border-style:outset;
background-color:White;
color:Black;
vertical-align:middle;
text-align:center;
}
#simplemodal-container a.modalCloseImg {
background:url(../images/x.png) no-repeat; /* adjust url as required*/
width:25px;
height:29px;
display:inline;
z-index:3200;
position:absolute;
top:-15px;
right:-18px;
cursor:pointer;
}任何关于如何解决这个问题的帮助都将不胜感激。
发布于 2011-02-19 03:32:30
如果您的数据扩展了容器,SimpleModal应该自动将overflow:'auto'添加到simplemodal-wrap目录中。如果由于某种原因它不是(由于您使用它的方式),您可以这样做:
jQuery('#CustLookupResults').modal({
containerCss: {
padding: 0,
width: 650,
},
maxHeight: 800,
onShow: function (dlg) {
$(dlg.container).css('height', 'auto');
$(dlg.wrap).css('overflow', 'auto'); // or try jQuery.modal.update();
},
overlayClose: true,
opacity: 75
});https://stackoverflow.com/questions/5032490
复制相似问题