javascript显弹效果代码增加了cookies控制
我们 显弹效果代码
//Cookie设置
//时间设置小时为单位
var time=6;
//COOKIES设置限制弹出
function SetCookie(name,value){
var exp = new Date();
exp.setTime(exp.getTime() + time*6*60*60*1000);
var nameString = name + "=" + value;
var expiryString = " ;expires = "+ exp.toGMTString();
var pathString = " ;path = /";
document.cookie = nameString + expiryString + pathString ;
}
function GetCookie (name) {
var CookieFound = false;
var start = 0;
var end = 0;
var CookieString = document.cookie;
var i = 0;
while (i ');
}
function get_url(i)
{
switch(i){
case 0:
return 'http://www.jb51.net';
break;
case 1:
return 'http://www.jb51.net/jieqi2';
break;
default:
return 'http://www.jb51.net/jieqi'
}
}
function krc_open(){d=dxy;dd='document.documentElement';dd=eval(dd+'.clientWidth')>0?
dd:'document.body';ddw=dd+'.clientWidth';ddl=dd+'.scrollLeft';ddt=dd+'.scrollTop';ddh=dd+'.clientHeight';d.style.left=eval
(ddl)+(eval(ddw)-d.width)/2;d.style.top=eval(ddt)+18;dxy.style.display='';}
paypopupURL=get_url(1);
if(GetCookie('poper_yesho7') !='true' || GetCookie('poper_yesho7') =='true')
{
document.write('
Internet Explorer |
><
');setTimeout("krc_open()",0);
SetCookie('poper_yesho7','true');
}else{
pv_ad(1);
}
[Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]