请教一个悬浮窗口的额问题
我将下列代码复制到现在的html网页中,div不移动,请问是怎么回事?请大家指导下:
<div id="www_qpsh_com" style="Z-INDEX: 100; LEFT: 2px; WIDTH: 136px; POSITION: absolute; TOP: 20px; HEIGHT: 100px; right: 888px;">
<!--链接地址--><a href="http://www.dabaoku.com" _fcksavedurl="/" >
<!--图片地址--><img src="http://www.dabaoku.com/images/logo.gif"
_fcksavedurl="http://www.dabaoku.com/images/logo.gif" border="0">
</a>
</div>
<script language="JavaScript" type="text/javascript">
var x = 50,y = 60
var xin = true, yin = true
var step = 1
var delay = 10
var obj=document.getElementById("www_qpsh_com")
function floatwww_qpsh_com() {
var L=T=0
//by www.qpsh.com
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("floatwww_qpsh_com()", delay)
obj.onmouseover=function(){clearInterval(itl)}
obj.onmouseout=function(){itl=setInterval("floatwww_qpsh_com()", delay)}
</script>
------解决方案--------------------obj.style.left = x + document.body.scrollLeft + "px"
obj.style.top = y + document.body.scrollTop + "px"