popShow弹出层的使用(二)
来源:互联网 发布:淘宝优惠券发放软件 编辑:程序博客网 时间:2024/06/09 21:17
popShow弹出层
图1.1 弹出层效果
1、引入JS和CSS文件
<link href="popShow.css" rel="stylesheet" type="text/css" /><script src="/js/common/jquery.min.js" type="text/javascript"></script> <script src="popShow.js" type="text/javascript"></script>
注意:这里需要引入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 ? true : false).appendTo('body').wrapAll('<table class=\"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 ? title : '') + '</div>').before($('<a class=\"g-popup-hide\" href=\"javascript:;\"></a>').click(function() { tag.popHide() })); return this};$.fn.popHide = function() { var tab = this.closest('table'); this.attr('par') == 'true' ? this.hide().appendTo('body') : this.remove(); tab.prev().remove(); tab.remove(); return this};
附件2:popShow.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)
0 0
- popShow弹出层的使用(二)
- popShow弹出层的使用(一)
- 弹出层(二)
- layer弹出层的使用(一)
- 弹出层/弹出对话框的使用
- JavaScript弹出层的使用
- 弹出层layer的使用
- jquery 弹出自定义层(二)
- 弹出层插件Avgrund的使用
- 弹出层layer的使用心得
- 整理:手机端弹出提示框,使用的bootstrap中的模态框(modal,弹出层),比kendo弹出效果好
- jquery 弹出层(thickbox)使用
- 使用层弹出对话框
- 弹出层使用【鸡蛋】
- 使用PopupWindow弹出层
- 解决KindEditor富文本编辑器model弹出层上文本框不能输入的问题(二)
- jquery的弹出层
- 弹出层的CSS
- Removing SSHD service
- C# DataTable Copy 与 Clone
- Longest Valid Parentheses 最长的有效括号
- 超级硬盘数据恢复软件 4.2.3.6注册码破解版
- oracle job使用详解及job不运行的检查方法
- popShow弹出层的使用(二)
- 阿里云服务器初次使用
- 如何在Linux下统计高速网络中的流量
- VLOOKUP制作EXCEL动态图
- 利用脚本扩展snmp收集信息
- csdn 以【源代码】的格式显示所贴的代码
- 可搜索、可多选的下拉列表控件使用
- Android设计模式系列(1)--SDK源码之组合模式
- Gesture - Rotation旋转