📄 template2.js
字号:
function ObjectAD() {
this.ADID = 0;
this.ADType = 0;
this.ADName = "";
this.ADFileURL = "";
this.ADWidth = 0;
this.ADHeight = 0;
this.LinkURL = "";
this.LinkTitle = "";
this.OpenType = 0;
this.FlashWmode = true;
this.ADRight = 0;
}
function MoveZoneAD(_id) {
this.ID = _id;
this.ZoneID = 0;
this.ZoneName = "";
this.ZoneWidth = 0;
this.ZoneHeight = 0;
this.ShowType = 0;
this.DivName = "";
this.DivName2 = "";
this.Left = 0;
this.Top = 0;
this.MoveType = 0;
this.Delta = 0.15;
this.AllAD = new Array();
this.ShowAD = null;
this.AddAD = MoveZoneAD_AddAD;
this.GetShowAD = MoveZoneAD_GetShowAD;
this.Show = MoveZoneAD_Show;
this.Move = MoveZoneAD_Move;
}
function MoveZoneAD_AddAD(_AD) {
this.AllAD[this.AllAD.length] = _AD;
}
function MoveZoneAD_GetShowAD() {
if(this.AllAD.length <= 0) { return; }
if (this.ShowType > 0) {
this.ShowAD = this.AllAD[0];
return;
}
var arrRnd = new Array();
for (var i = 0; i < this.AllAD.length; i++) {
for(var j = 0; j < this.AllAD[i].ADRight; j++){
arrRnd[arrRnd.length] = this.AllAD[i];
}
}
var sum = arrRnd.length;
var rndNum = parseInt(Math.random() * sum);
this.ShowAD = arrRnd[rndNum];
}
function MoveZoneAD_Show() {
if (!this.AllAD) { return; }
this.GetShowAD();
if (this.ShowAD == null) return false;
this.DivName = "MoveZoneAD_Div1" + this.ZoneID;
this.DivName2 = "MoveZoneAD_Div2" + this.ZoneID;
if (this.ShowAD.ADWidth) this.ShowAD.ADWidth = this.ZoneWidth
if (this.ShowAD.ADHeight) this.ShowAD.ADHeight = this.ZoneHeight
if (ADDir == "") ADDir = "AD"
if (navigator.appName == "Netscape") {
if(this.MoveType == 0){
document.write("<layer id='" + this.DivName + "' top='" + this.Top + "' left='"+ this.Left +"' width='" + this.ZoneWidth + "' height='" + this.ZoneHeight + "'>" + AD_Content(this.ShowAD) + "</layer>");
document.write("<layer id='" + this.DivName2 + "' top='" + this.Top + "' left='"+ (document.body.clientWidth-this.Left-this.ShowAD.ADWidth) +"' width='" + this.ZoneWidth + "' height='" + this.ZoneHeight + "'>" + AD_Content(this.ShowAD) + "</layer>");
}else if(this.MoveType == 1){
document.write("<layer id='" + this.DivName + "' top='" + this.Top + "' left='"+ this.Left +"' width='" + this.ZoneWidth + "' height='" + this.ZoneHeight + "'>" + AD_Content(this.ShowAD) + "</layer>");
}else{
document.write("<layer id='" + this.DivName2 + "' top='" + this.Top + "' left='"+ (document.body.clientWidth-this.Left-this.ShowAD.ADWidth) +"' width='" + this.ZoneWidth + "' height='" + this.ZoneHeight + "'>" + AD_Content(this.ShowAD) + "</layer>");
}
} else {
if(this.MoveType == 0){
document.write("<div id='" + this.DivName + "' style='position:absolute; visibility:visible; z-index:1; width:" + this.ZoneWidth + "; height:" + this.ZoneHeight + "; left:" + this.Left + ";top:" + this.Top + "'>" + AD_Content(this.ShowAD) + "</div>");
document.write("<div id='" + this.DivName2 + "' style='position:absolute; visibility:visible; z-index:2; width:" + this.ZoneWidth + "; height:" + this.ZoneHeight + "; left:" + (document.body.clientWidth-this.Left-this.ShowAD.ADWidth) + ";top:" + this.Top + "'>" + AD_Content(this.ShowAD) + "</div>");
}else if(this.MoveType == 1){
document.write("<div id='" + this.DivName + "' style='position:absolute; visibility:visible; z-index:1; width:" + this.ZoneWidth + "; height:" + this.ZoneHeight + "; left:" + this.Left + ";top:" + this.Top + "'>" + AD_Content(this.ShowAD) + "</div>");
}else{
document.write("<div id='" + this.DivName2 + "' style='position:absolute; visibility:visible; z-index:2; width:" + this.ZoneWidth + "; height:" + this.ZoneHeight + "; left:" + (document.body.clientWidth-this.Left-this.ShowAD.ADWidth) + ";top:" + this.Top + "'>" + AD_Content(this.ShowAD) + "</div>");
}
}
setInterval(this.ID + ".Move()", 10);
}
function MoveZoneAD_Move() {
var ObjectDiv = null;
var tempLeft = this.Left;
for(var i=1;i<=2;i++){
ObjectDiv = document.getElementById("MoveZoneAD_Div"+ i + this.ZoneID);
if(ObjectDiv){
if(i == 2) tempLeft = document.body.clientWidth-this.Left-this.ShowAD.ADWidth;
if (ObjectDiv.offsetLeft != (document.body.scrollLeft + tempLeft)) {
var dx = (document.body.scrollLeft + tempLeft - ObjectDiv.offsetLeft) * this.Delta;
dx = (dx > 0 ? 1 : - 1) * Math.ceil(Math.abs(dx));
ObjectDiv.style.left = ObjectDiv.offsetLeft + dx;
}
if (ObjectDiv.offsetTop != (document.body.scrollTop + this.Top)) {
var dy = (document.body.scrollTop + this.Top - ObjectDiv.offsetTop) * this.Delta;
dy = (dy > 0 ? 1 : - 1) * Math.ceil(Math.abs(dy));
ObjectDiv.style.top = ObjectDiv.offsetTop + dy;
}
ObjectDiv.style.display = '';
}
}
}
function AD_Content(o) {
var str = "";
var str = "";
if (o.ADType == 0 || o.ADType == 1) {
o.ADFileURL = o.ADFileURL.toLowerCase()
if (o.ADFileURL.indexOf(".swf") != - 1) {
str = "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0'";
str += " name='AD_" + o.ADID + "' id='AD_" + o.ADID + "'";
str += " width='" + o.ADWidth + "'";
str += " height='" + o.ADHeight + "'";
if (o.style) str += " style='" + o.style + "'";
if (o.extfunc) str += " " + o.extfunc + " ";
str += ">";
str += "<param name='movie' value='" + o.ADFileURL + "'>";
if (o.FlashWmode) str += "<param name='wmode' value='Transparent'>";
if (o.play) str += "<param name='play' value='" + o.play + "'>";
if (typeof(o.loop) != "undefined") str += "<param name='loop' value='" + o.loop + "'>";
str += "<param name='quality' value='autohigh'></object>";
str = "<embed ";
str += " name='AD_" + o.ADID + "' id='AD_" + o.ADID + "'";
str += " width='" + o.ADWidth + "'";
str += " height='" + o.ADHeight + "'";
if (o.style) str += " style='" + o.style + "'";
if (o.extfunc) str += " " + o.extfunc + " ";
str += " src='" + o.ADFileURL + "'";
if (o.FlashWmode) str += " wmode='Transparent'";
if (o.play) str += " play='" + o.play + "'";
if (typeof(o.loop) != "undefined") str += " loop='" + o.loop + "'";
str += " quality='autohigh'"
str += " pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash'></embed>";
str += "</object>";
} else if (o.ADFileURL.indexOf(".gif") != - 1 || o.ADFileURL.indexOf(".jpg") != - 1 || o.ADFileURL.indexOf(".jpeg") != - 1 || o.ADFileURL.indexOf(".bmp") != - 1 || o.ADFileURL.indexOf(".png") != - 1) {
if (o.LinkURL) {
o.LinkURL = InstallDir + ADDir + "/ADCount.asp?Action=Click&ADID=" + o.ADID
str += "<a href='" + o.LinkURL + "' target='" + ((o.OpenType == 0) ? "_self" : "_blank") + "' title='" + o.LinkTitle + "'>";
}
str += "<img ";
str += " name='AD_" + o.ADID + "' id='AD_" + o.ADID + "'";
if (o.style) str += " style='" + o.style + "'";
if (o.extfunc) str += " " + o.extfunc + " ";
str += " src='" + o.ADFileURL + "'";
if (o.ADWidth) str += " width='" + o.ADWidth + "'";
if (o.ADHeight) str += " height='" + o.ADHeight + "'";
str += " border='0'>";
if (o.LinkURL) str += "</a>";
}
}
return str;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -