87,921
社区成员
发帖
与我相关
我的任务
分享
function hidead()
{document.getElementById("ad").style.display="none";}
document.write("<div id='ad' style='position:absolute'>");
document.write("<div onclick='hidead();' align=right>关闭</div>"); //关闭这俩字一会横着一会竖着
document.write("<a href='http://' target='_blank'><img src='/adfile/UploadPic/2005-11/200511423790672.jpg' width='100'
height='100' border=0 alt='test'></a>");
document.write("</div>");
var x = 50,y = 60
var xin = true, yin = true
var step = 1
var delay = 1
var obj=document.getElementById("ad")
function floatAD() {
var L=T=0
var R= document.documentElement.clientWidth-obj.offsetWidth
var B = document.documentElement.clientHeight-obj.offsetHeight
obj.style.left = x + document.documentElement.scrollLeft
obj.style.top = y + document.documentElement.scrollTop
x = x + step*(xin?1:-1)
if (x < L) { xin = true; x = L}
if (x > R){ xin = false; x = R}
y = y + step*(yin?1:-1)
if (y < T) { yin = true; y = T }
if (y > B) { yin = false; y = B }
}
var itl= setInterval("floatAD()", delay)
obj.onmouseover=function(){clearInterval(itl)}
obj.onmouseout=function(){itl=setInterval("floatAD()", delay)}