jQuery弹出层插件popShow(改进版)用法示例

本文实例讲述了jQuery弹出层插件popShow(改进版)用法分享给大家供大家参考,具体如下:

前面一篇《》分析了popShow插件的基本用法,这里再对插件进行一番改进。

popShow弹出层

1、引入JS和CSS文件

注意:这里需要引入jQuery库文件。

2、编写HTML代码

3、popShow的使用

(1) 打开弹出层

(2) 关闭弹出层

附件

附件1:popShow.js

').appendTo('body'); this.show().attr('par',this.parent().length ? true : false).appendTo('body').wrapAll('').before('

附件2:popShow.css

rush:css;"> /*弹出层*/ .g-mask,.g-mask iframe,.g-popup { width:100%; height:100%; } .g-mask { background:#fff; filter:alpha(opacity=80); opacity:0.8; } .g-mask iframe { filter:alpha(opacity=0); opacity:0; } .g-mask,.g-popup { position:fixed; top:0; left:0; z-index:10000; _position:absolute; _top:expression(documentElement.scrollTop + "px");} .g-black-mask {background:#000;opacity:0.7;} .g-black-popup{position:absolute;} .g-popup { text-align:center; } .g-popup-wrap { padding:30px; background:#fff; border:#E95A59 solid 4px; text-align:left; position:relative; margin:0 auto; } .g-popup-title { font-size:14px; height:28px; line-height:28px; overflow:hidden; margin-bottom:20px; font-weight:bold; color:#e25150; border-bottom:1px dotted #AAAAAA} .g-popup-hide {background:url("/images/popBtn.png") 0 0 no-repeat; width:34px; height:30px; display:block; position:absolute; right:5px; top:5px; z-index:99; } .g-popup-hide:hover { background-position:0 -40px; } .g-info-hide { width:34px; height:30px; display:block; position:absolute; background-position:0 -1320px; top:5px; right:5px; } .g-info-hide:hover { background-position:0 -1360px; } .g-popup-tip { height: 0; overflow: hidden; position: fixed; z-index:10001; bottom: 0; right: 0; _position: absolute; _bottom: auto; _top: expression(eval(document.documentElement.scrollTop + document.documentElement.clientHeight - this.offsetHeight - (parseInt(this.currentStyle.marginTop,10) || 0) - (parseInt(this.currentStyle.marginBottom,10) || 0)));}

附件3:关闭按钮图标(popBtn.png)

更多关于jQuery相关内容感兴趣的读者可查看本站专题:《》、《》、《》、《》、《》、《》、《》及《

希望本文所述对大家jQuery程序设计有所帮助。

相关文章

jQuery表单验证提交:前台验证一(图文+视频)
jQuery表单验证提交:前台验证二(图文+视频)
jQuery如何实时监听获取input输入框的值
JQuery怎么判断元素是否存在
jQuery如何实现定时重定向
jquery如何获取复选框选中的值