jquery.artwl.thickbox.js 一个非常简单好用的jQuery弹出层插件

2020-05-19 07:34:18易采站长站整理

});
})(jQuery);

调用也非常简单,在页面引入此JS文件后,在页面加载方法中调用如下代码即可:
$.artwl_bind({ showbtnid: “btn_show”, title: “From Cnblogs Artwl”, content: $(“#Content”).html() });
  这三个参数非常简单,第一个是弹出层触发事件的元素ID,第二个为弹出层的标题,第三个为弹出层的内容
注意事项
  为了使用方便,本插件把JS跟CSS写在了一个文件中,如果要调整弹出层的样式可以修改如下CSS即可。
  插件CSS代码:

html, body, h1, h2, h3, h4, h5 {
margin: 0px;
padding: 0px;
}
#artwl_mask {
background – color: #000;
position: absolute;
top: 0px;
left: 0px;
width: 100%;
height: 100%;
opacity: 0.5;
filter: alpha(opacity= 50);
display: none;
}
#artwl_boxcontain {
margin: 0 auto;
position: absolute;
z – index: 2;
line – height: 28px;
display: none;
}
#artwl_showbox {
padding: 10px;
background: #FFF;
border – radius: 5px;
margin: 20px;
min – width: 300px;
min – height: 200px;
}
#artwl_title {
position: relative;
height: 27px;
border – bottom: 1px solid #999;
}
# artwl_close {
position: absolute;
cursor: pointer;
outline: none;
top: 0;
right: 0;
z – index: 4;
width: 42px;
height: 42px;
overflow: hidden;
background – image: url(/Images/feedback – close.png);
_background: none;
}
#artwl_message {
padding: 10px 0px;
overflow: hidden;
line – height: 19px;
}

另外,针对IE6不支持透明作了特殊处理,在IE6下显示为:


IE6



其他浏览器


Demo下载地址:http://xiazai.jb51.net/201203/yuanma/thickbox_demo.rar