|
<script>
function turnoff(obj){
document.getelementbyid(obj).style.display="none";
}
</script>
<div id="ad" style="position:absolute;z-index:10">
<a href="#">点击关闭</a><br>
<a href="http://www.sfsfsfsf.com/about.asp?id=49" target="_blank"><img src="http://www.sfsfsfsf.com/danbao.jpg" border="0">
</a></div>
<div id="ad" style="position:absolute;z-index:11">
<script>
var x = 50,y = 60
var xin = true, yin = true
var step = 1
var delay = 10
var obj=document.getelementbyid("ad")
function floatad() {
var l=t=0
var r= document.body.clientwidth-obj.offsetwidth
var b = document.body.clientheight-obj.offsetheight
obj.style.left = x + document.body.scrollleft
obj.style.top = y + document.body.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)}
</script>
</div> |
|