⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 head.js

📁 本人参见电子竞赛的时候搜集和整理的有关电子秤的资料
💻 JS
字号:
function ObjectAD() {
  /* Define Variables*/
  this.ADID        = 0;
  this.ADType      = 0;
  this.ADName      = "";
  this.ImgUrl      = "";
  this.ImgWidth    = 0;
  this.ImgHeight   = 0;
  this.FlashWmode  = 0;
  this.LinkUrl     = "";
  this.LinkTarget  = 0;
  this.LinkAlt     = "";
  this.Priority    = 0;
  this.CountView   = 0;
  this.CountClick  = 0;
  this.InstallDir  = "";
  this.ADDIR       = "";
  this.StartTime   = 0;
  this.EndTime     = 0;
  this.Cid         = "";
}

function FixedZoneAD(_id) {
  /* Define Common Variables*/
  this.ID          = _id;
  this.ZoneID      = 0;
  this.ZoneName    = "";
  this.ZoneWidth   = 0;
  this.ZoneHeight  = 0;
  this.ShowType    = 1;
  this.DivName     = "";
  this.Div         = null;
  this.Active	   = 1;	

  /* Define Unique Variables*/
  this.Left        = 0;
  this.Top         = 0;

  /* Define Objects */
  this.AllAD       = new Array();
  this.ShowAD      = null;

  /* Define Functions */
  this.AddAD       = FixedZoneAD_AddAD;
  this.GetShowAD   = FixedZoneAD_GetShowAD;
  this.Show        = FixedZoneAD_Show;

}

function FixedZoneAD_AddAD(_AD) {
  var now = new Date();
  var s = now.getTime();
  var Url=top.window.location.href;
  var cid=GetQueryValue(Url,"cid");
  if(cid=="")cid=0;
  cid = ","+cid+","; 
  s = (s-s%1000)/1000;
  if (this.Active == 1 && s > _AD.StartTime && s < _AD.EndTime && _AD.Cid.indexOf(cid) != -1){
	this.AllAD[this.AllAD.length] = _AD;
  }
}

function FixedZoneAD_GetShowAD() {
  if (this.ShowType > 1) {
    this.ShowAD = this.AllAD[0];
    return;
  }
  var num = this.AllAD.length;
  var sum = 0;
  for (var i = 0; i < num; i++) {
    sum = sum + this.AllAD[i].Priority;
  }
  if (sum <= 0) {return ;}
  var rndNum = Math.random() * sum;
  i = 0;
  j = 0;
  while (true) {
    j = j + this.AllAD[i].Priority;
    if (j >= rndNum) {break;}
    i++;
  }
  this.ShowAD = this.AllAD[i];
}

function FixedZoneAD_Show() {
  if (!this.AllAD) {
    return;
  } else {
    this.GetShowAD();
  }

  if (this.ShowAD == null) return false;
  this.DivName = "FixedZoneAD_Div" + this.ZoneID;
  if (!this.ShowAD.ImgWidth) this.ShowAD.ImgWidth = this.ZoneWidth
  if (!this.ShowAD.ImgHeight) this.ShowAD.ImgHeight = this.ZoneHeight
  if (this.ShowAD.ADDIR=="") this.ShowAD.ADDIR = "AD"
  if (navigator.appName == "Netscape") {
    document.write("<layer id='" + this.DivName + "' top='" + this.Top + "' width='" + this.ZoneWidth + "' height='" + this.ZoneHeight + "'>" + AD_Content(this.ShowAD) + "</layer>");
  } else {
    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>");
  }
  this.Div = document.getElementById(this.DivName);
}

function AD_Content(o) {
  var str = "";
  if (o.ADType == 1 || o.ADType == 2) {
  imgurl = o.ImgUrl .toLowerCase()
    if (o.InstallDir.indexOf("http://") != - 1) imgurl = o.InstallDir.substr(0, o.InstallDir.length - 1) + imgurl;
    if (imgurl.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.ImgWidth + "'";
      str += " height='" + o.ImgHeight + "'";
      if (o.style) str += " style='" + o.style + "'";
      if (o.extfunc) str += " " + o.extfunc + " ";
      str += ">";
      str += "<param name='movie' value='" + imgurl + "'>";
      if (o.FlashWmode == 1) 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'>";
      str += "<embed ";
      str += " name='AD_" + o.ADID + "' id='AD_" + o.ADID + "'";
      str += " width='" + o.ImgWidth + "'";
      str += " height='" + o.ImgHeight + "'";
      if (o.style) str += " style='" + o.style + "'";
      if (o.extfunc) str += " " + o.extfunc + " ";
      str += " src='" + imgurl + "'";
      if (o.FlashWmode == 1) 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 (imgurl.indexOf(".gif") !=  - 1 || imgurl.indexOf(".jpg") !=  - 1 || imgurl.indexOf(".jpeg") !=  - 1 || imgurl.indexOf(".bmp") !=  - 1 || imgurl.indexOf(".png") !=  - 1) {
      if (o.LinkUrl) {
        str += "<a href='" + o.LinkUrl + "' target='" + ((o.LinkTarget == 0) ? "_self" : "_blank") + "' title='" + o.LinkAlt + "'>";
      }
      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='" + imgurl + "'";
      if (o.ImgWidth) str += " width='" + o.ImgWidth + "'";
      if (o.ImgHeight) str += " height='" + o.ImgHeight + "'";
      str += " border='0'>";
      if (o.LinkUrl) str += "</a>";
    }
  } else if (o.ADType == 3 ) {
		if (o.LinkUrl) {
			str = "<a href='" + o.LinkUrl + "' target='" + ((o.LinkTarget == 0) ? "_self" : "_blank") + "' title='" + o.LinkAlt + "'>" + o.ADIntro + "</a>";
		}else{
			str = o.ADIntro;
		}
  } else if (o.ADType == 4 ) {
    str = o.ADIntro;
  } else if (o.ADType == 5) {
    str = "<iframe id='" + "AD_" + o.ADID + "' marginwidth=0 marginheight=0 hspace=0 vspace=0 frameborder=0 scrolling=no width=100% height=100% src='" + o.ImgUrl + "'>wait</iframe>";
  }
  return str;
}

function GetQueryValue(sorStr,panStr){     
  var vStr="";     
  if(sorStr==null || sorStr=="" || panStr==null || panStr=="")return vStr;     
  sorStr = sorStr.toLowerCase();   
  panStr += "=";     
  var itmp=sorStr.indexOf(panStr);     
  if (itmp<0){return vStr;}     
  sorStr = sorStr.substr(itmp+panStr.length);     
  itmp=sorStr.indexOf("&");     
  if (itmp<0){   
	return sorStr;     
  }else{   
	sorStr=sorStr.substr(0,itmp);     
	return sorStr;   
  }     
}
var ZoneAD_1 = new FixedZoneAD("ZoneAD_1");
ZoneAD_1.ZoneID      = 1;
ZoneAD_1.ZoneWidth   = 760;
ZoneAD_1.ZoneHeight  = 90;
ZoneAD_1.ShowType    = 1;
ZoneAD_1.Left        = 0;
ZoneAD_1.Top         = 0;
ZoneAD_1.Active      = 1;

var objAD = new ObjectAD();
objAD.ADID           = 1;
objAD.ADType         = 4;
objAD.ADName         = "头部Banner";
objAD.ImgUrl         = "";
objAD.ImgWidth       = 100;
objAD.ImgHeight      = 100;
objAD.FlashWmode     = 0;
objAD.ADIntro        = "<script type=\"text/JavaScript\"> \nalimama_pid=\"mm_10090427_604548_1280605\"; \nalimama_titlecolor=\"0000FF\"; \nalimama_descolor =\"000000\"; \nalimama_bgcolor=\"FFFFFF\"; \nalimama_bordercolor=\"E6E6E6\"; \nalimama_linkcolor=\"008000\"; \nalimama_bottomcolor=\"FFFFFF\"; \nalimama_anglesize=\"0\"; \nalimama_bgpic=\"0\"; \nalimama_icon=\"0\"; \nalimama_sizecode=\"11\"; \nalimama_width=760; \nalimama_height=90; \nalimama_type=2; \n</script> \n<script src=\"http://a.alimama.cn/inf.js\" type=text/javascript> \n</script>";
objAD.LinkUrl        = "";
objAD.LinkTarget     = 1;
objAD.LinkAlt        = "";
objAD.Priority       = 1;
objAD.CountView      = 0;
objAD.CountClick     = 0;
objAD.InstallDir     = "/";
objAD.ADDIR          = "";
objAD.StartTime      = 1176422400;
objAD.EndTime        = 1239494400;
objAD.Cid			 = ",0,2,51,53,52,39,6,9,10,11,34,35,36,37,38,14,29,30,31,32,33,15,16,17,18,19,20,21,22,50,23,24,25,26,28,12,13,42,43,45,46,47,40,41,55,56,54,57,";
ZoneAD_1.AddAD(objAD);
ZoneAD_1.Show();

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -