easyui 中iframe嵌套页面,大弹窗自适应居中的解决方法。$('#win').window()
显示
maskTop = window.top.$("#mask-top" maskLeft = window.top.$("#mask-left"'body').css('overflow','hidden');禁止滚动
}
maskTop = window.top.$("#mask-top" maskLeft = window.top.$("#mask-left"'body').css('overflow','auto');
}
显示
$(</span>'#win'<span style="color: #000000;">).window({
width:</span>800<span style="color: #000000;">,height:</span>560<span style="color: #000000;">,modal:</span><span style="color: #0000ff;">true</span><span style="color: #000000;">,title:</span>'<a href="https://www.jb51.cc/tag/tianjia/" target="_blank" class="keywords">添加</a>区域'<span style="color: #000000;">,collapsible:</span><span style="color: #0000ff;">false</span><span style="color: #000000;">,minimizable:</span><span style="color: #0000ff;">false</span><span style="color: #000000;">,maximizable:</span><span style="color: #0000ff;">false</span><span style="color: #000000;">,draggable:</span><span style="color: #0000ff;">false</span><span style="color: #000000;">,resizable:</span><span style="color: #0000ff;">false</span><span style="color: #000000;">,onClose : </span><span style="color: #0000ff;">function</span><span style="color: #000000;"> () {
</span><span style="color: #008000;">/*</span><span style="color: #008000;">外层 遮罩隐藏</span><span style="color: #008000;">*/</span><span style="color: #000000;">
wrapMaskHide();
}
});
winHiSelfAdaptation($(</span>'#win'));<span style="color: #008000;">//</span><span style="color: #008000;">高度自适应</span>
<span style="color: #000000;">
}
以下是弹窗高度自适应居中的方法
htmlW = $(window).width();页面宽度
oParent = o.parents('.window');
h = w = mgt = h/2;//弹窗高度一半
mgl = w/2;//宽度一半
'position':'fixed''top':'50%''left':'50%''margin-top':-mgt+'px''margin-left':-mgl-100+'px'//这里的-100是因为左边目录栏宽度是200px,为了居中,所有弹窗margin-left需要减去100px(htmlW<1000'margin-left',-mgl+'px'显示器,避免弹窗被左边目录栏遮住
}
}
通过以上代码和说明,就能完美解决easyui 中iframe嵌套页面,大弹窗自适应居中问题。$('#win').window()
原文链接:https://www.f2er.com/jquery/403439.html