
<html>
<head>
<meta http-equiv=content-type content=text/html; charset=gb2312>
<title>带关闭按钮地网页漂浮广告代码</title>
</head>
<body>
<div id=img style=position: absolute; left: 311; top: 815;visibility :hidden; onmouseover=clearinterval(interval) onmouseout=interval = setinterval('changepos()', delay) align=right>
<a href=# target=_blank><img border=0 src=图片路径 onload=return imgzoom(this,600); onclick=javascript:window.open(this.src); style=cursor:pointer;/></a>
<span style=cursor:hand;color:red;font-weight:bold onclick=clearinterval(interval);img.style.visibility = 'hidden'>x</span>
</div>
<script language=javascript src=ff.js>
</script>
</body>
</html>
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-fly.com/a/jisuanjixue/article-51416-1.html
死亡和无政府主义