设定具体像素值高度,在大屏显示没问题,在更小屏显示却撑破浏览器,导致关闭不了,部分信息查看不了。
可参考的解决方法:获取浏览器时下窗口可视区域高度 ,对比设定的高度像素值,取最小的那一个。
//打开弹窗 height:具体设定的高度像素值
function openWin(title, width, height, content, callback) {
var winH = $(window).height();//浏览器时下窗口可视区域高度
if(winH < height){
height = winH;
}
layer.open({
type: 2,
title: title,
closeBtn: 1, //关闭按钮风格:1,2
shift: 0, //动画效果,0~6
area: [width + 'px', height + 'px'],
fix: false, //不固定
maxmin: true,
content: content,//引入哪个页面
end: callback
});
}