我想要个浮动广告的代码
我有一个
可是只能浮动一会就自动消失,我想让它一直浮动除非点击关闭
这是我的代码。各位帮我看哈
谢了~~~
<div id="img" style="position:absolute;; width: 100; height: 100"><a href="list.asp?unid=261"><img src="fdgg/001.gif" border="0"></a></div>
<script LANGUAGE="JavaScript">
var xPos = 20;
var yPos = 10;
img.style.left= xPos;
img.style.top = yPos;
var step = 1;
var delay = 50;
var width,height,Hoffset,Woffset;
var y = 1;
var x = 1;
var interval;
img.visibility = "visible";
function changePos()
{
width = document.body.clientWidth;
height = document.body.clientHeight;
Hoffset = img.offsetHeight;
Woffset = img.offsetWidth;
if (y)
{
yPos = yPos + step;
}
else
{
yPos = yPos - step;
}
if (yPos < 0)
{
y = 1;
yPos = 0;
}
if (yPos >= (height - Hoffset))
{
y = 0;
yPos = (height - Hoffset);
}
if (x)
{
xPos = xPos + step;
}
else
{
xPos = xPos - step;
}
if (xPos < 0)
{
x = 1;
xPos = 0;
}
if (xPos >= (width - Woffset))
{
x = 0;
xPos = (width - Woffset);
}
img.style.left = xPos + document.body.scrollLeft;
img.style.top = yPos + document.body.scrollTop;
}
function start()
{
interval = setInterval('changePos()', delay);
}
function pause_resume()
{
clearInterval(interval);
}
start();
</script>