本文实例讲述了jQuery弹出层插件popShow(改进版)用法。分享给大家供大家参考,具体如下:
前面一篇《jQuery弹出层插件popShow用法示例》分析了popShow插件的基本用法,这里再对插件进行一番改进。
popShow弹出层
图1.1 弹出层效果
1、引入JS和CSS文件
<link href="popShow.css" rel="stylesheet" type="text/css" /> <script src="/UploadFiles/2021-04-02/jquery.min.js">注意:这里需要引入jQuery库文件。
2、编写HTML代码
<div id="swinLogin" style="width:230px; display:none;"> <table> <tr> <th>用户名</th> <td><input id="txtUserName" type="text" /></td> </tr> <tr> <th>密码</th> <td><input id="txtPsw" type="password" /></td> </tr> <tr> <th></th> <td><input type="button" value="登录" /></td> </tr> </table> </div>3、popShow的使用
(1) 打开弹出层
$("#swinLogin").popShow("用户登录");(2) 关闭弹出层
$("#swinLogin").popHide();附件
附件1:popShow.js
$.fn.popShow = function(title) { var tag = this; $('<div class=\"g-mask\"><iframe frameborder=\"0\" scrolling=\"no\"></iframe></div>').appendTo('body'); this.show().attr('par', this.parent().length "g-popup\"><tr><td></td></tr></table>'); this.wrapAll('<div class=\"g-popup-wrap\" style=\"width:' + this.outerWidth(true) + 'px\"></div>').before('<div class=\"g-popup-title g-line-dashed\">' + (title "g-popup-hide\" href=\"javascript:;\"></a>').click(function() { tag.popHide() })); return this }; $.fn.popHide = function() { var tab = this.closest('table'); this.attr('par') == 'true' "htmlcode">/*弹出层*/ .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中Ajax用法总结》、《jQuery表格(table)操作技巧汇总》、《jQuery拖拽特效与技巧总结》、《jQuery扩展技巧总结》、《jQuery常见经典特效汇总》、《jQuery动画与特效用法总结》及《jquery选择器用法总结》
希望本文所述对大家jQuery程序设计有所帮助。
华山资源网 Design By www.eoogi.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
华山资源网 Design By www.eoogi.com
暂无评论...
稳了!魔兽国服回归的3条重磅消息!官宣时间再确认!
昨天有一位朋友在大神群里分享,自己亚服账号被封号之后居然弹出了国服的封号信息对话框。
这里面让他访问的是一个国服的战网网址,com.cn和后面的zh都非常明白地表明这就是国服战网。
而他在复制这个网址并且进行登录之后,确实是网易的网址,也就是我们熟悉的停服之后国服发布的暴雪游戏产品运营到期开放退款的说明。这是一件比较奇怪的事情,因为以前都没有出现这样的情况,现在突然提示跳转到国服战网的网址,是不是说明了简体中文客户端已经开始进行更新了呢?
更新日志
2024年09月24日
2024年09月24日
- 时代少年团《「叁重楼」演唱会 -「楼间楼」重庆站LIVE》[FLAC/分轨][820.86MB]
- 许廷铿2017《THEULTIMATECOLLECTION》2CD[星梦娱乐][WAV+CUE]
- 许佳慧-独家情话[WAV+CUE]
- 张惠妹《ThePowerOfA-Mei》2018[SACD/ISO]
- 陈珊妮.2013-低调人生2CD【和气音乐】【WAV+CUE】
- 群星.2000-超级BAND.BAND.BAND【滚石】【WAV+CUE】
- 许志安.2002-On.Show演唱会2CD(2024环球红馆40复刻系列)【环球】【WAV+CUE】
- 蔡琴-哈利路亚2016[SACD/ISO]
- 陈随意2011-今生只为你[豪记][WAV+CUE]
- 陈随意2008-爱的总铺师[美华][WAV+CUE]
- 裘德《一棵树所创造的》[320K/MP3][56.21MB]
- 裘德《一棵树所创造的》[24bit 48kHz][FLAC/分轨][355.1MB]
- 卓依娜姆《美人谋 网剧影视原声带》[320K/MP3][48.29MB]
- 张星特.2024-流绪呢喃【中视鸣达】【FLAC分轨】
- 邓紫棋.2010-MYSECRET【蜂鸟音乐】【WAV+CUE】