优化UI的右侧打开页面的打开效果,宽度自适应度增强。

This commit is contained in:
hdm 2022-10-13 17:53:08 +08:00
parent 3e02defc49
commit 98362bcdf2

View File

@ -9,10 +9,16 @@ layui.define([], function (exports) {
return false; return false;
} }
that.loading = true; that.loading = true;
var sideWidth = window.innerWidth > 1280 ? '1200px' : '996px'; var countWidth = window.innerWidth-(window.innerWidth*0.5)+456;
if(window.innerWidth<=1000){
countWidth = 750;
}
if (width && width > 0) { if (width && width > 0) {
sideWidth = width + 'px'; sideWidth = width + 'px';
} }
else{
sideWidth = countWidth + 'px';
}
layer.open({ layer.open({
type: 2, type: 2,
title: '', title: '',
@ -37,8 +43,11 @@ layui.define([], function (exports) {
}) })
}) })
$(window).resize(function () { $(window).resize(function () {
width = window.innerWidth > 1280 ? '1200' : '996'; var resizeWidth = window.innerWidth-(window.innerWidth*0.5)+456;
obj.width(width); if(window.innerWidth<=1000){
resizeWidth = 750;
}
obj.width(resizeWidth);
}) })
} }
}) })
@ -50,10 +59,16 @@ layui.define([], function (exports) {
return false; return false;
} }
that.loading = true; that.loading = true;
var sideWidth = window.innerWidth > 1280 ? '1200px' : '996px'; var countWidth = window.innerWidth-(window.innerWidth*0.5)+456;
if(window.innerWidth<=1000){
countWidth = 750;
}
if (width && width > 0) { if (width && width > 0) {
sideWidth = width + 'px'; sideWidth = width + 'px';
} }
else{
sideWidth = countWidth + 'px';
}
$.ajax({ $.ajax({
url: url, url: url,
type: "GET", type: "GET",
@ -88,8 +103,11 @@ layui.define([], function (exports) {
}) })
}) })
$(window).resize(function () { $(window).resize(function () {
width = window.innerWidth > 1280 ? '1200' : '996'; var resizeWidth = window.innerWidth-(window.innerWidth*0.5)+456;
$('#expressLayer').width(width); if(window.innerWidth<=1000){
resizeWidth = 750;
}
$('#expressLayer').width(resizeWidth);
}) })
} }