复制代码代码如下 :
<!->->
<script type = "text/javaScript"언어 = "javaScript">
함수 addevent (obj, evttype, func, cap) {
캡 = 캡 || 거짓;
if (obj.addeventListener) {
obj.addeventListener (evttype, func, cap);
진실을 반환하십시오.
} else if (obj.attachevent) {
if (cap) {
obj.setCapture ();
진실을 반환하십시오.
} 또 다른 {
return obj.attachevent ( "on" + evttype, func);
}
} 또 다른 {
거짓을 반환합니다.
}
}
함수 getPagesCroll () {
var xscroll, yscroll;
if (self.pagexoffset) {
xscroll = self.pagexoffset;
} else if (document.documentElement && document.documentElement.scrollleft) {
xscroll = document.documentElement.scrollleft;
} else if (document.body) {
xscroll = document.body.scrollleft;
}
if (self.pageyoffset) {
yscroll = self.pageyoffset;
} else if (document.documentElement && document.documentElement.scrolltop) {
yscroll = document.documentElement.scrolltop;
} else if (document.body) {
yscroll = document.body.scrolltop;
}
ArrayPagesCroll = New Array (Xscroll, yscroll);
반환 ArrayPagesCroll;
}
함수 getPagesize () {
var xscroll, yscroll;
if (window.innerheight && window.scrollmaxy) {
xscroll = document.body.scrollwidth;
yscroll = window.innerHeight + Window.scrollMaxy;
} else if (document.body.scrollheight> document.body.offsetheight) {
xscroll = document.body.scrollwidth;
yscroll = document.body.scrollheight;
} 또 다른 {
xscroll = document.body.offsetwidth;
yscroll = document.body.offsetheight;
}
var Windowwidth, WindowHeight;
if (self.innerheight) {
windowwidth = self.innerwidth;
WindowHeight = self.innerHeight;
} else if (document.documentElement && document.documentElement.clientHeight) {
WindowWidth = document.documentElement.clientWidth;
WindowHeight = Document.DocumentELement.ClientHeight;
} else if (document.body) {
WindowWidth = document.body.clientWidth;
WindowHeight = document.body.clientHeight;
}
if (yscroll <windowheight) {
PageHeight = WindowHeight;
} 또 다른 {
PageHeight = yscroll;
}
if (xscroll <windowwidth) {
pagewidth = windowwidth;
} 또 다른 {
pagewidth = xscroll;
}
ArrayPagesize = New Array (PageWidth, PageHeight, Windowwidth, WindowHeight)
arraypagesize를 반환합니다.
}
var admoveconfig = new Object ();
admoveconfig.isinitialized = false;
AdmoveConfig.scrollx = 0;
Admoveconfig.scrolly = 0;
AdmoveConfig.moveWidth = 0;
AdmoveConfig.moveHeight = 0;
AdmoveConfig.resize = function () {
var winsize = getPagesize ();
admoveconfig.movewidth = winsize [2];
AdmoveConfig.moveHeight = Winsize [3];
AdmoveConfig.scroll ();
}
AdmoveConfig.scroll = function () {
var winscroll = getPagesCroll ();
admoveconfig.scrollx = winscroll [0];
admoveconfig.scrolly = winscroll [1];
}
addevent (창, "크기 조정", admoveconfig.resize);
addevent (창, "스크롤", admoveconfig.scroll);
함수 관리 (id) {
if (! admoveconfig.isinitialized) {
AdmoveConfig.resize ();
admoveconfig.isinitialized = true;
}
var obj = document.getElementById (id);
obj.style.position = "절대";
var w = admoveconfig.movewidth- obj.offsetwidth;
var h = admoveconfig.moveHeight- obj.offsetheight;
var x = w * math.random (), y = h * math.random ();
var rad = (math.random () + 1) * math.pi / 6;
var kx = math.sin (rad), ky = math.cos (rad);
var dirx = (math.random () <0.5? 1 : -1), diry = (math.random () <0.5? 1 : -1);
var 단계 = 1;
var 간격;
this.setLocation = function (vx, vy) {x = vx; y = vy; }
this.setDirection = function (vx, vy) {dirx = vx; diry = vy; }
obj.custommethod = function () {
obj.style.left = (x + admoveconfig.scrollx) + "px";
obj.style.top = (y + admoveconfig.scrolly) + "px";
rad = (math.random () + 1) * math.pi / 6;
w = admoveconfig.movewidth- obj.offsetwidth;
h = admoveconfig.moveHeight- obj.offsetheight;
x = x + step * kx * dirx;
if (x <0) {dirx = 1; x = 0; kx = Math.sin (rad); ky = math.cos (rad); }
if (x> w) {dirx = -1; x = w; kx = Math.sin (rad); ky = math.cos (rad); }
y = y + step * ky * diry;
if (y <0) {diry = 1; y = 0; kx = Math.sin (rad); ky = math.cos (rad); }
if (y> h) {diry = -1; y = h; kx = Math.sin (rad); ky = math.cos (rad); }
}
this.run = function () {
var 지연 = 10;
interval = setInterval (obj.custommethod, Delay);
obj.onmouseover = function () {clearinterval (Interval); }
obj.onmouseout = function () {interval = setInterval (obj.custommethod, Delay); }
}
}
</스크립트>
<!->->
<div id = ad2 style = "z-index : 5; 위치 : 상대">
<a href = 'policehtk.aspx'target = '_ blank'> <img src = "images/fudong/fudong.jpg"> </a> </a> <br> <a href = "#"onclick = "occure.getElementById ( 'ad2'). style.display = 'none' '> image/fud/1.g. /> </a>
<!->->
</div>
<script type = "text/javaScript"언어 = "javaScript">
var ad2 = 새로운 교칭 ( "ad2");
ad2.run ();
// 多组漂浮
</스크립트>
<!->->