<script language=JavaScript>
speed=200;
pageheight=0;
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
}setInterval('KB_keepItInIE("KBStatic",0,0)',1)</script>
<body>
<SCRIPT> 
for(i=100; i<140; i++){ 
document.write("◇◇"+i+"◇◇<br>") 

</SCRIPT>
<div id="KBStatic" style="position:absolute; left:3px; top:0px; width:553px; height:70px; z-index:25"> 
********************************************************************************</div> 
</body>

解决方案 »

  1.   

    用dreamwear4 的一个插件:Nirvana Floating Layer
    (若找不到,可发邮件向我索要:[email protected])
      

  2.   

    http://www.blueidea.com/bbs/newsdetail.asp?id=418813http://www.blueidea.com/bbs/newsdetail.asp?id=434955
      

  3.   

    to :上边几位,如果div中有table和 button怎么做啊?
      

  4.   

    也是一样啊
    <script language=JavaScript>
    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
    }
    setInterval('KB_keepItInIE("KBStatic",0,0)',1)
    </script>
    <body>
    <SCRIPT> 
    for(i=100; i<140; i++){ 
    document.write("◇◇"+i+"◇◇<br>") 

    </SCRIPT>
    <div id="KBStatic" style="background:green;position:absolute; left:3px; top:0px; width:553px; height:70px; z-index:25"> 
    ********************************************************************************
    <input type=button>
    <table><tr><td>content</td></tr></table>
    </div> 
    </body>
      

  5.   

    刚编的,你试试可以吗?
    <div id="style1" style="position: absolute; left: 823; top: 456; width: 163; height: 57">
      你看,我自岿然不动
    </div>
    <script>
    x0=parseInt(style1.style.left);
    y0=parseInt(style1.style.top);function doDiv(){
       y=document.body.scrollTop;
       x=document.body.scrollLeft;
       style1.style.top=y0+y;
    style1.style.left=x0+x;
    }
    </script>
      

  6.   

    忘了,还有这个要加上。
    <body onscroll="doDiv()">
      

  7.   

    <div id="style1"  style="background:green;position: absolute; left: 0; top: 0; width: 100%; height: 20px">
      你看,你看,月亮偷偷地在改变
    </div>
    <script>
    x0=parseInt(style1.style.left);
    y0=parseInt(style1.style.top);
    function window.onscroll(){
    y=document.body.scrollTop;
    x=document.body.scrollLeft;
    style1.style.top=y0+y;
    style1.style.left=x0+x;
    }
    </script>
    <body magin=0 rightmagin=0>
    <table style="width:100%;magin=0">
    <tr style="20px"><td>
    <tr><td>
    <script>
    for(i=100; i<140; i++){ 
    document.write("◇◇"+i+"◇◇<br>") 

    </script>
    </table>
    </body>