浮动是广告,js的,使用后cpu占用就到100%,是不是那里有死循环啊,请高手帮我解决啊!
<div style= 'position:absolute ' id=ad>
<embed wmode= "transparent " src= "./浮动.swf " width=300 height=220 border=0>
<p class=MsoNormal> <span lang=EN-US>
<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>
上面代码使用后,cpu占用就到100%,是不是有死循环,请高手帮我解决啊,急用在线等啊!
------解决方案--------------------没发现有什么问题,先把换成图片,看看是不是你的浏览器对flash的显示有问题。
------解决方案--------------------哦!MY GOD!
------解决方案--------------------mark