网创优客建站品牌官网
为成都网站建设公司企业提供高品质网站建设
热线:028-86922220
成都专业网站建设公司

定制建站费用3500元

符合中小企业对网站设计、功能常规化式的企业展示型网站建设

成都品牌网站建设

品牌网站建设费用6000元

本套餐主要针对企业品牌型网站、中高端设计、前端互动体验...

成都商城网站建设

商城网站建设费用8000元

商城网站建设因基本功能的需求不同费用上面也有很大的差别...

成都微信网站建设

手机微信网站建站3000元

手机微信网站开发、微信官网、微信商城网站...

建站知识

当前位置:首页 > 建站知识

怎么在jQuery中使用popShow弹出层插件

怎么在jQuery中使用popShow弹出层插件?相信很多没有经验的人对此束手无策,为此本文总结了问题出现的原因和解决方法,通过这篇文章希望你能解决这个问题。

创新互联建站-专业网站定制、快速模板网站建设、高性价比柳林网站开发、企业建站全套包干低至880元,成熟完善的模板库,直接使用。一站式柳林网站制作公司更省心,省钱,快速模板网站建设找我们,业务覆盖柳林地区。费用合理售后完善,十年实体公司更值得信赖。

popShow弹出层

怎么在jQuery中使用popShow弹出层插件

图1.1 弹出层效果

1、引入JS和CSS文件



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

2、编写HTML代码


  
    
      
      
    
    
      
      
    
    
      
      
    
  
用户名
密码

3、popShow的使用

(1) 打开弹出层

$("#swinLogin").popShow("用户登录");

(2) 关闭弹出层

$("#swinLogin").popHide();

附件

附件1:popShow.js

$.fn.popShow = function(title) {
  var tag = this;
  $('
').appendTo('body');   this.show().attr('par', this.parent().length ? true : false).appendTo('body').wrapAll('');   this.wrapAll('
').before('' + (title ? title : '') + '').before($('').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)));}

看完上述内容,你们掌握怎么在jQuery中使用popShow弹出层插件的方法了吗?如果还想学到更多技能或想了解更多相关内容,欢迎关注创新互联行业资讯频道,感谢各位的阅读!


当前题目:怎么在jQuery中使用popShow弹出层插件
本文路径:http://bjjierui.cn/article/jocsps.html