欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

jquery弹出层类代码分享

程序员文章站 2023-11-23 14:52:10
代码如下:var t9 = new popuplayer({trigger:"#ele9",popupblk:"#blk9",closebtn:"#close9",useoverl...

代码如下:


var t9 = new popuplayer({trigger:"#ele9",popupblk:"#blk9",closebtn:"#close9",
useoverlay:true,usefx:true,offsets:{x:0,y:-41}});
t9.doeffects = function(way){
    if(way == "open"){
        this.popuplayer.css({opacity:0.3}).show(400,function(){
            this.popuplayer.animate({
                left:($(document).width() - this.popuplayer.width())/2,
                top:(document.documentelement.clientheight -
                    this.popuplayer.height())/2 + $(document).scrolltop(),
                opacity:0.8
            },1000,function(){this.popuplayer.css("opacity",1)}.binding(this));
        }.binding(this));
    }
    else{
        this.popuplayer.animate({
            left:this.trigger.offset().left,
            top:this.trigger.offset().top,
            opacity:0.1
        },{duration:500,complete:function(){
            this.popuplayer.css("opacity",1);this.popuplayer.hide()}.binding(this)});
    }
}