带关闭漂浮广告代码带关闭漂浮广告代码
带关闭按钮地网页漂浮广告代码
x
ff.js代码
var xpos = 20;
var ypos = document.body.clientheight;
var step = 1;
var delay = 30;
var height = 0;
var hoffset = 0;
var woffset = 0;
var yon = 0;
var xon = 0;
var pause = true;
var interval;
img.style.top = ypos;
function changepos() {
width = document.body.clientwidth;
height = document.body.clientheight;
hoffset = img.offsetheight;
woffset = img.offsetwidth;
img.style.left = xpos + document.body.scrollleft;
img.style.top = ypos + document.body.scrolltop;
if (yon) {
ypos = ypos + step;
}
else {
ypos = ypos - step;
}
if (ypos < 0) {
yon = 1;
ypos = 0;
}
if (ypos >= (height - hoffset)) {
yon = 0;
ypos = (height - hoffset);
}
if (xon) {
xpos = xpos + step;
}
else {
xpos = xpos - step;
}
if (xpos < 0) {
xon = 1;
xpos = 0;
}
if (xpos >= (width - woffset)) {
xon = 0;
xpos = (width - woffset);
}
}
function start() {
img.style.visibility = visible;
interval = setinterval('changepos()', delay);
}
start();
本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-/a/jisuanjixue/article-51416-1.html