var page = {}; var layerzmboxpage,layerbackground; /*var layerzmbox = function(url,type,title,call,area,shade,bgcolor,closebtn,titlestyle){ title = title || product; area = area || ["405px","336px"]; shade = shade || [0.3, '#000']; closebtn: closebtn || [0, true,""]; if(bgcolor == undefined) bgcolor = "#fff"; if(layerbackground) bgcolor = layerbackground; if(!$('body').data(url)){ $('body').data(url,"1"); page.html = '
'; page.url = url; page.ok = function(datas){ $('body').removedata(url); } layerzmboxpage = jquery.layer({ type: 1, title: title, area: area, border: [0], shade: shade, titlestyle:titlestyle, //fix: true, closebtn: closebtn, //shadeclose: true, bgcolor: bgcolor, shift: 'left', page: page, end: function(){ call && call(); layerzmboxpage = 0; } }); } }*/ // layerzmbox('',1,'','',['420px', '240px']); var layerzmbox = function(url,type,title,call,area,shade,bgcolor,closebtn,titlestyle){ type = type || 1; title = title || '默认'; area = area || ['420px', '240px']; var index = layer.load(1, {shade: false}); //0代表加载的风格,支持0-2 $.ajax({ url: url, timeout: 30000, //超时时间 success: function (data) { layer.close(index); //页面层 layerzmboxpage = layer.open({ type: type, title:title, //skin: 'layui-layer-rim', //加上边框 area: area, //宽高 content: data }); }, error:function(){ layer.close(index); } }); } var layerzmboxclose = function(){ layer.close(layerzmboxpage); } var layermsg = function(msg,time,type){ type = type || 1; time = time || 2; layer.msg(msg,{icon:type,time:time*1000}); } var layerconfirm = function(msg,surecallback,cancelcallback,option){ var option = option || {icon: 3, title:'提示'}; layer.confirm(msg,option,function(index){ if(typeof(surecallback) != 'undefined') surecallback(); layer.close(index); },function(){ if(typeof(cancelcallback) != 'undefined') cancelcallback(); }); } var layeropen = function(url,type,title,call,area){ type = type || 2; layer.open({ type: 2, title: title, shadeclose: true, shade: 0.8, area: area, content: url //iframe的url }); }