相思资源网 Design By www.200059.com
有些网站接了一些广告,可以不用弹窗可以用这个脚本控制实现,内容显示的地方需要有个id,因为这样好控制,不能点击任何地方都出现吧,这样可以增加用户体验。
复制代码 代码如下:
<!--
var adurl = new Array(9);
var adurl_i = 0;
adurl[0] = "https://www.jb51.net/";
adurl[1] = "http://www.baidu.com/";
adurl[2] = "http://www.g.cn/";
adurl[3] = "http://s.jb51.net/";
adurl[4] = "http://play.jb51.net";
adurl[5] = "http://pda.jb51.net/";
adurl[6] = "http://liulanqi.jb51.net/";
adurl[7] = "http://hi.baidu.com/";
adurl[8] = "http://www.google.cn/";

function getExpDate(days, hours, minutes)
{
var expDate = new Date();
if(typeof(days) == "number" && typeof(hours) == "number" && typeof(hours) == "number")
{
expDate.setDate(expDate.getDate() + parseInt(days));
expDate.setHours(expDate.getHours() + parseInt(hours));
expDate.setMinutes(expDate.getMinutes() + parseInt(minutes));
return expDate.toGMTString();
}
}

function getCookieVal(offset)
{
        var endstr = document.cookie.indexOf(";", offset);
if(endstr == -1)
{
endstr = document.cookie.length;
}
return unescape(document.cookie.substring(offset, endstr));
}

function getCookie(name)
{
var arg = name + "=";
var alen = arg.length;
var clen = document.cookie.length;
var i = 0;
while(i < clen)
{
var j = i + alen;
if (document.cookie.substring(i, j) == arg)
{
return getCookieVal(j);
}
i = document.cookie.indexOf(" ", i) + 1;
if(i == 0) break;
}
return;
}

function setCookie(name, value, expires, path, domain, secure)
{
document.cookie = name + "=" + escape(value) +
((expires) ? "; expires=" + expires : "") +
((path) ? "; path=" + path : "") +
((domain) ? "; domain=" + domain : "") +
((secure) ? "; secure" : "");
}

function autosubmit(gourli){
     var tempa = document.getElementById("gourla");
     setCookie("isgourla","y",getExpDate(0,1,0));
     tempa.href = adurl[gourli];
tempa.click();
}

function selectFrom(iFirstValue,iLastValue){
var iChoces = Math.abs(iLastValue - iFirstValue) + 1;
return Math.floor(Math.random() * iChoces + iFirstValue);
}

document.writeln("<a id=\"gourla\" target=\"_blank\"><\/a>");
document.onclick = function(e)
{
var event = window.event || e;
var ele = event.srcElement || event.target;
if((ele.id == "acontent"||ele.tagName=="P"||ele.tagName=="p")&&getCookie("isgourla")!="y"){
        adurl_i = selectFrom(0,8);
        if(adurl_i<9){
autosubmit(adurl_i);
}
    }        
}
//-->
标签:
文章内容,弹出页面

相思资源网 Design By www.200059.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
相思资源网 Design By www.200059.com

评论“点击文章内容处弹出页面代码”

暂无点击文章内容处弹出页面代码的评论...