http://www.baron.com.cn/javascript里面能找到你要的东西

解决方案 »

  1.   

    将GIF放到一个ID为"border"的层中:<div id="border" style="position:absolute; top:0; left:0; z-index:2;">
    <img src="http://go.6to23.com/qingang1983/001/2003081634035280.gif">
    </div>然后加入如下代码:<script Language="Javascript">
    <!--
    //以下是保持border层随窗口内容滚动而自动滚动
    function KB_keepItInIE(theName,theWantTop,theWantLeft)
    {
    theRealTop = parseInt(document.body.scrollTop);
    theTrueTop = theWantTop+theRealTop;
    document.all[theName].style.top = theTrueTop;
    theRealLeft = parseInt(document.body.scrollLeft);
    theTrueLeft = theWantLeft+theRealLeft;
    document.all[theName].style.left = theTrueLeft;
    }function KB_keepItInNN(theName,theWantX,theWantY)
    {
    theRealLay = document.layers[theName];
    theBadX = self.pageYOffset;
    theBadY = self.pageXOffset;
    theRealX = theBadX+theWantX;
    theRealY = theBadY+theWantY;
    theRealLay.moveTo(theRealY,theRealX);
    }IE4 = (document.all) ? 1 : 0;
    NN4 = (document.layers) ? 1 : 0;
    if (document.all.border)//检测当前页面中是否有ID为"border"的层
    { if (IE4)
    {
    setInterval('KB_keepItInIE("border",0,0)',1);
    } if (NN4)
    {
    setInterval('KB_keepItInNN("border",0,0)',1);
    }
    }
    //-->
    </script>
      

  2.   

    document.body.scrollTop//滚动条向下滚动的距离
    document.body.scrollLeft//滚动条向右滚动的距离
    document.body.scrollLeft+div.style.posLeft//当前层Left位置
    document.body.scrollTop+div.style.posTop//当前层Top位置