$(function(){ //加载弹出层 layui.use(['form','element'], function(){ layer = layui.layer; element = layui.element; }); }); //弹出层 /* 参数解释: title 标题 url 请求的url id 需要操作的数据id w 弹出层宽度(缺省调默认值) h 弹出层高度(缺省调默认值) */ function x_admin_show(title,url,w,h){ var isopen = true; $.ajax({ type:"get", url:url, async:false, success:function(data){ data = json.parse(data); if(data.status == 0){ isopen = false; layer.alert(); } }, error:function(){ isopen = false } }); if(isopen == false){ return false; } if(title == null || title == ''){ title = false; } if(url == null || url == ''){ url = "404.html"; } if(w == null || w == ''){ w = ($(window).width() * 0.9); } if(h == null || h == ''){ h = ($(window).height() - 50); } layer.open({ type:2, area:[w + 'px',h + 'px'], fix:false, //不固定 maxmin:true, shadeclose:true, shade:0.4, title:title, content:url }); } function amplificationimg(url){ let height = $(window).height() - 50;//拿的图片原来宽高,建议自定义宽高 // let height = document.body.clientheight - 50;//拿的图片原来宽高,建议自定义宽高 let width = $(window).width() * 0.9; // let width = document.body.clientwidth * 0.9; layer.open({ type:1, title:false, closebtn:0, shadeclose:true, area:[width + 'px',height + 'px'], //宽高 content:"" }); }