PageSourceSearch

https://www.celaj.gov.cn/cn/scripts/float.js

js celaj.gov.cn collected 2026-10-02 10:04:49 UTC 5,714 bytes, 135 lines download raw bytes

1/*
2 * 浮动广告插件
3 * 
4 */
5
6function EIPFloatAD(settings){
7	this.PositionID = settings.PositionID //广告位ID
8	this.PaddingLeft =(typeof settings.PaddingLeft === 'number')?settings.PaddingLeft:0; //左内边距  起始位置
9    this.PaddingTop = (typeof settings.PaddingTop === 'number')?settings.PaddingTop:0;  //上内边距     超始位置
10    this.Width = (typeof settings.Width === 'number')?settings.Width:100;       //广告位宽
11    this.Height =(typeof settings.Height === 'number')?settings.Height:100;      //广告位高
12    this.Step =(typeof settings.Step === 'number')?settings.Step:1;  //默认为1
13    this.Delay = (typeof settings.Delay === 'number')?settings.Delay:20;//默认为20;
14    this.WindowHeight = (typeof settings.WindowHeight === 'number')?settings.WindowHeight:0;//默认为0
15    this.WindowWidth = (typeof settings.WindowWidth === 'number')?settings.WindowWidth:0;//默认为0
16    this.Yon = (typeof settings.Yon === 'number')?settings.Yon:0;   //默认为0
17    this.Xon = (typeof settings.Xon === 'number')?settings.Xon:0;    //默认为0
18    this.Pause = true;     //暂停状态 
19    this.Interval = null;
20    this.SysPath=(settings.SysPath===null)?"/":settings.SysPath;//默认为"/"
21    this.SiteID=(typeof settings.SiteID === 'number')?settings.SiteID:0;  // 默认为0
22    this.URL=(settings.URL===null)?"/":settings.URL;
23   
24    /*
25     * ADID: 广告ID
26     * Title:广告标题
27     * LinkUrl:广告链接地址
28     * ImageUrl:广告图片或flash路径 
29     * ADType:广告类型(image或flash)
30     */
31    this.ADContent=settings.ADContent;    //广告内容
32    return this;
33};
34
35
36/*
37 * 启动
38 */
39EIPFloatAD.prototype.start=function(){
40	var self=this;
41  console.log(self.PaddingLeft);
42function showADContent() {
43   // alert(self.ADContent);
44    var str = "<div id='ZCMSAD_" + self.PositionID + "' style='left:" + self.PaddingLeft + "px;top:" + self.PaddingTop + "px;width:" + self.Width + "px; height:" + self.Height + "px; position: absolute;visibility: visible;z-index:999999;' >";
45    var json = self.ADContent;
46    for(var i=0;i<self.ADContent.length;i++)
47    {
48    if (self.ADContent[i].ADType == "image") {
49        str += "<a href='" + self.ADContent[i].LinkUrl + "' target='" + self.ADContent[i].Target+ "'>";
50        str += "<img title='" + self.ADContent[i].Title + "' src='" + self.ADContent[i].ImageUrl + "' width='" + self.Width + "' height='" + self.Height + "' onerror=\"this.src='"+self.SysPath+"res/images/nofile.jpg'\"  style='border:0px;'>";
51        str += "</a>";
52    } else if (self.ADContent[i].ADType == "flash") {
53        document.write("&nbsp;");//至少要输出一个字,不然IE不显示
54       str += "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' width='"+self.Width+"' height='"+self.Height+"' id='FlashAD_"+self.ADContent[i].ADID+"' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0'>";
55	  str += "<param name='movie' value='"+self.ADContent[i].ImageUrl+"' />"; 
56      str += "<param name='quality' value='autohigh' />";
57      str += "<param name='wmode' value='opaque'/>";
58	  str += "<embed wmode='opaque' src='"+self.ADContent[i].ImageUrl+"' quality='autohigh' name='flashad' swliveconnect='TRUE' pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width='"+self.Width+"' height='"+self.Height+"'></embed>";
59      str += "</object>";
60    }
61    }
62   // alert(str);
63    str += "<div style='text-align:right;'><a href='#' class='aclose' onclick='javascript:document.getElementById(\"ZCMSAD_" + self.PositionID + "\").style.display=\"none\"'>关闭</a></div>";
64    str += "</div>";
65    
66    document.write(str);
67    }
68
69	
70	function changePos(float) {
71    float.WindowWidth = document.documentElement.clientWidth;
72    float.WindowHeight = document.documentElement.clientHeight;
73    document.getElementById("ZCMSAD_" + float.PositionID).style.left = (float.PaddingLeft + document.documentElement.scrollLeft) + "px";
74    document.getElementById("ZCMSAD_" + float.PositionID).style.top = (float.PaddingTop + document.documentElement.scrollTop) + "px";
75    if (float.Yon) {
76        float.PaddingTop = float.PaddingTop + float.Step;
77    } else {
78        float.PaddingTop = float.PaddingTop - float.Step;
79    }
80    if (float.PaddingTop < 0) {
81        float.Yon = 1;
82        float.PaddingTop = 0;
83    }
84    if (float.PaddingTop >= (float.WindowHeight - float.Height)) {
85        float.Yon = 0; float.PaddingTop = (float.WindowHeight - float.Height);
86    }
87    if (float.Xon) {
88        float.PaddingLeft = float.PaddingLeft + float.Step;
89    } else {
90        float.PaddingLeft = float.PaddingLeft - float.Step;
91    }
92    if (float.PaddingLeft < 0) {
93        float.Xon = 1;
94        float.PaddingLeft = 0;
95    }
96    if (float.PaddingLeft >= (float.WindowWidth - float.Width)) {
97        float.Xon = 0;
98        float.PaddingLeft = (float.WindowWidth - float.Width);
99    }
100}
101	
102	
103function doStart(float) {
104    return function() {
105        changePos(float);
106    }
107    
108    
109}
110
111function pause(float)
112{
113	if (float.Pause) {
114        clearInterval(float.Interval);
115        float.Pause = false;
116    } else {
117        float.Interval = setInterval(doStart(float), float.Delay);
118        float.Pause = true;
119    }
120}
121
122showADContent();
123//doStart(self);
124self.Interval = setInterval(doStart(self), self.Delay);
125
126$("#ZCMSAD_"+self.PositionID).mouseover(function(){
127		pause(self);
128	});
129	$("#ZCMSAD_"+self.PositionID).mouseout(function(){
130		pause(self);
131	});
132return self;
133
134};
135

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.