当前位置:网站首页 > 横幅广告 > 正文

高仿京东网站广告弹出层 dialog

作者:admin发布时间:2021-08-30分类:横幅广告浏览:评论:23


导读:HTML代码如下,亲测。==============================================================================...

高仿京东网站广告弹出层 dialog

HTML代码如下,亲测。

=======================================================================================

=""*全局广告样式*/#{;;;;display:none;margin:0auto;z-index:10001}.layer{width:100%;height:100%;position:fixed;top:0px;left:0px;filter:alpha(opacity=50);opacity:0.5;background:#000;z-index:1000;display:none}.globalContent{width:600px;height:400px;}.globalContentimg{max-width:600px;height:400px;}.closeIco{width:400px;height:50px;margin-left:20px;position:absolute;left:345px;cursor:pointer;background:url("http://pics.rebatesme.com/newrm/images/cha.png")no-repeatscroll190px0;}/*全局广告样式End*//style/headbodydivstyle="width:2000px;height:2500px;background:#fcc;"/div!--全局广告开始--divclass="layer"/divdivid="globalAd"spanonclick="closeGlobalAd();"class="closeIco"/spanahref='http://www.erdangjiade.com/topic/186.html'target="_blank"class="globalContent"onclick="redirectUrlToActive();"imgsrc="http://www.erdangjiade.com/Public/images/get_vip.png"//a/div!--全局广告结束--/body/htmlscript/*全局广告开始*///=================================================================jquery.cookieStart=======================================jQuery.cookie=function(name,value,options){if(typeofvalue!='undefined'){//nameandvaluegiven,setcookieoptions=options||{};if(value===null){value='';options.expires=-1;}varexpires='';if(options.expires(typeofoptions.expires=='number'||options.expires.toUTCString)){vardate;if(typeofoptions.expires=='number'){date=newDate();vartotalTime=24*3600;/*vartotalTime=(1440-79)*60;*/varhour=date.getHours();varminutes=date.getMinutes();varseconds=date.getSeconds();varpastTime=3600*hour+60*minutes+seconds;varleftTime=totalTime-pastTime;date.setTime(date.getTime()+(options.expires*leftTime*1000));}else{date=options.expires;}expires=';expires='+date.toUTCString();//useexpiresattribute,max-ageisnotsupportedbyIE}//CAUTION:Neededtoparenthesizeoptions.pathandoptions.domain//inthefollowingexpressions,otherwisetheyevaluatetoundefined//inthepackedversionforsomereason...varpath=options.path?';path='+(options.path):'';vardomain=options.domain?';domain='+(options.domain):'';varsecure=options.secure?';secure':'';document.cookie=[name,'=',encodeURIComponent(value),expires,path,domain,secure].join('');}else{//onlynamegiven,getcookievarcookieValue=null;if(document.cookiedocument.cookie!=''){varcookies=document.cookie.split(';');for(vari=0;icookies.length;i++){varcookie=jQuery.trim(cookies[i]);//Doesthiscookiestringbeginwiththenamewewant?if(cookie.substring(0,name.length+1)==(name+'=')){cookieValue=decodeURIComponent(cookie.substring(name.length+1));break;}}}returncookieValue;}};//================================================================jquery.cookieEnd===========================================================================$(function(){//SetthepopupwindowtocentervarCOOKIE_NAME="erdangjiade";if($.cookie(COOKIE_NAME)){$(".layer").hide();$("#globalAd").hide();}else{varerdangjiadeH=$(window).height();varerdangjiadeW=$(window).width();$(".layer").show();$("#globalAd").css({'top':erdangjiadeH/2-$("#globalAd").height()/2,'left':erdangjiadeW/2-$("#globalAd").width()/2});$("#globalAd").slideDown(300,function(){setTimeout("closeGloableAd()",'300000');});$.cookie(COOKIE_NAME,"erdangjiade",{path:'/',expires:1});}});//关闭全局广告方法functioncloseGlobalAd(){$('#globalAd').hide();$('.layer').hide();}//跳转广告方法functionredirectUrlToActive(){$('#globalAd').hide();$('.layer').hide();}/*全局广告结束*//script


已有23位网友发表了看法:

欢迎 发表评论: