关闭对话框前我的代码...
$('body').css('overflow','hidden');
$('.ui-widget-overlay').css('width','100%');
$('#content').removeClass('lightbox_bg');
$('#saveDialog').dialog('close');
我的 CSS...
<style>
.lightbox_bg {
background:rgb(153,153,153) none repeat scroll 0 0;
left:0;
filter:alpha(opacity=50);
opacity: 0.5;
top:0;
width:100%;
z-index:50;
position:fixed;
}
.modal{
position:absolute;
z-index:51;
}
当对话框打开时,滚动保持不变,但当它关闭时,滚动消失,使页面保持在同一位置。任何想法。谢谢。
最佳答案
是的,因为你有这条线
$('body').css('overflow','hidden'); // Setting overflow hidden on body and thus removing the scroll bar
删除此行,它将使您的滚动条返回。
关于jquery - jquery 对话框关闭时页面滚动消失,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33707489/