<body>
<script language=JavaScript defer>
function KB_keepItInIE(theName,theWantTop,theWantLeft) {
theRealTop=parseInt(document.body.scrollTop)
theTrueTop=theWantTop+theRealTop
KBStatic.style.top=theTrueTop                          //问题所在处
theRealLeft=parseInt(document.body.scrollLeft)
theTrueLeft=theWantLeft+theRealLeft
KBStatic.style.left=theTrueLeft
}   setInterval('KB_keepItInIE("KBStatic",0,640)',1)   //调用
</script>
<div id="KBStatic" style="position:absolute">层的内容</div>

解决方案 »

  1.   

    <script language=JavaScript defer>请问这句加上defer是什么意思 ??
      

  2.   

    如果我把KB_keepItInIE(theName,theWantTop,theWantLeft)这个函数改为KB_keepItInIE(theName),然后在<div id="KBStatic" style="position:absolute">这块定义绝对位置,是不是就可以避免错误而达到相同的效果
      

  3.   

    你最初的代码错误所在是:KBStatic还没加载,但你要操作它,自然提示KBStatic未定义我已通过脚本标记加defer解决,要么把你的setInterval放进onload事件顺便问一句,你要把该层移动到指定位置吗?我并未理解你代码的真正意图
      

  4.   

    bencalie(Bencalie) 已经帮你解决了啊