从网易撬过来的js调用广告显示文件
只有下面短短几行代码可以随机显示flash和gif广告,还不错
复制代码 代码如下:
function column02(imgSource,url,chance,type) {
this.imgSource = imgSource;
this.url = url;
this.chance = chance;
this.type = type;
}
function dispColumn02() {
with (this)
switch (type){
case "img":
document.write("<A HREF=" + url + " target=_blank><IMG SRC=" + imgSource + " WIDTH=480 HEIGHT=250 BORDER=0></A>");
break;
case "html":
document.write("<IFRAME WIDTH=480 HEIGHT=250 MARGINWIDTH=0 MARGINHEIGHT=0 HSPACE=0 VSPACE=0 FRAMEBORDER=0 SCROLLING=no BORDERCOLOR=#000000 SRC="+ imgSource + "></iframe>");
break;
case "flash":
document.write("<embed src="/UploadFiles/2021-04-02/+imgSource+">break;
default:
document.write("");
}
}
column02.prototype.dispColumn02 = dispColumn02;
columns02 = new Array();
// flash , html , img 代表三种不同的广告模式
// 200 之类的数目是设置出现的机率
columns02[0] = new column02("http://smsimg.163.com/honey/honey_ad.swf","",200,"flash");//主广告
columns02[1] = new column02("http://smsimg.163.com/honey/honey_photo.swf","",800,"flash"); //上传图片免月租
columns02[2] = new column02("http://smsimg.163.com/honey/honey_gold.swf","",800,"flash"); //登陆送金币
//columns02[] = new column02("f","",100,"");// (20030422~20030722)
sum_of_all_chances = 0;
for (i = 0; i < columns02.length; i++) {
sum_of_all_chances += columns02[i].chance;
}
function randomColumn02() {
chance_limit = 0;
randomly_selected_chance = Math.round((sum_of_all_chances - 1) * Math.random()) + 1;
for (i = 0; i < columns02.length; i++) {
chance_limit += columns02[i].chance;
if (randomly_selected_chance <= chance_limit) {
columns02[i].dispColumn02();
break;
}
}
}
this_column02 = randomColumn02();
测试代码,chance越大显示的几率越大
[Ctrl+A 全选 注:引入外部Js需再刷新一下页面才能执行]
只有下面短短几行代码可以随机显示flash和gif广告,还不错
复制代码 代码如下:
function column02(imgSource,url,chance,type) {
this.imgSource = imgSource;
this.url = url;
this.chance = chance;
this.type = type;
}
function dispColumn02() {
with (this)
switch (type){
case "img":
document.write("<A HREF=" + url + " target=_blank><IMG SRC=" + imgSource + " WIDTH=480 HEIGHT=250 BORDER=0></A>");
break;
case "html":
document.write("<IFRAME WIDTH=480 HEIGHT=250 MARGINWIDTH=0 MARGINHEIGHT=0 HSPACE=0 VSPACE=0 FRAMEBORDER=0 SCROLLING=no BORDERCOLOR=#000000 SRC="+ imgSource + "></iframe>");
break;
case "flash":
document.write("<embed src="/UploadFiles/2021-04-02/+imgSource+">break;
default:
document.write("");
}
}
column02.prototype.dispColumn02 = dispColumn02;
columns02 = new Array();
// flash , html , img 代表三种不同的广告模式
// 200 之类的数目是设置出现的机率
columns02[0] = new column02("http://smsimg.163.com/honey/honey_ad.swf","",200,"flash");//主广告
columns02[1] = new column02("http://smsimg.163.com/honey/honey_photo.swf","",800,"flash"); //上传图片免月租
columns02[2] = new column02("http://smsimg.163.com/honey/honey_gold.swf","",800,"flash"); //登陆送金币
//columns02[] = new column02("f","",100,"");// (20030422~20030722)
sum_of_all_chances = 0;
for (i = 0; i < columns02.length; i++) {
sum_of_all_chances += columns02[i].chance;
}
function randomColumn02() {
chance_limit = 0;
randomly_selected_chance = Math.round((sum_of_all_chances - 1) * Math.random()) + 1;
for (i = 0; i < columns02.length; i++) {
chance_limit += columns02[i].chance;
if (randomly_selected_chance <= chance_limit) {
columns02[i].dispColumn02();
break;
}
}
}
this_column02 = randomColumn02();
测试代码,chance越大显示的几率越大
[Ctrl+A 全选 注:引入外部Js需再刷新一下页面才能执行]
标签:
调用广告,随机
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件!
如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
狼山资源网 Copyright www.pvsay.com
暂无“从网易扒过来的js调用广告显示文件(随机几率)”评论...
RTX 5090要首发 性能要翻倍!三星展示GDDR7显存
三星在GTC上展示了专为下一代游戏GPU设计的GDDR7内存。
首次推出的GDDR7内存模块密度为16GB,每个模块容量为2GB。其速度预设为32 Gbps(PAM3),但也可以降至28 Gbps,以提高产量和初始阶段的整体性能和成本效益。
据三星表示,GDDR7内存的能效将提高20%,同时工作电压仅为1.1V,低于标准的1.2V。通过采用更新的封装材料和优化的电路设计,使得在高速运行时的发热量降低,GDDR7的热阻比GDDR6降低了70%。