如果你对该文章中的内容有疑问/不解,可以点击此处链接提问
要注明问题和此文章链接地址 点击此处跳转
简单的弹窗小案例
效果:在本页面弹框打开王明昌博客页面
HTML
1 |
<a href="#" onclick="WeAdminShow('王明昌博客','https://www.wangmingchang.com/')"><i class="iconfont icon-ui"></i>王明昌博客</a> |
JS
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
window.WeAdminShow = function(title, url, w, h) { 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 }); } |