http://www.babypips.com/school/
和这个网站左边部分的那个框,当浏览器滚动时,网站左边框固定位置

解决方案 »

  1.   

    http://blog.csdn.net/cj205/archive/2010/12/23/6093496.aspx
    不懂问
      

  2.   

    随滚动条滚动而滚动的层(div)
      

  3.   

    css 就能实现,ie6大概要在 css 里掺 js
      

  4.   

    <div id="oLayer" style="position:absolute;left:30;top:60;z-index:2;background:green;width:120px;height:70px">
    <script>
    window.onscroll = onScroll;  
    function onScroll(){  
              
        var labeller_layer = document.getElementById('oLayer');  
        var scrollTop = document.documentElement.scrollTop + document.body.scrollTop;     
        labeller_layer.style.top = scrollTop  + 'px';       
    };  
    </script>这个代码可行,已经测试过IE6/FF/360!绝对可行!CHROME/SAFARI还没有测试过,但是我估计一定也可以!基本可以全部兼容大部分常见浏览器!
      

  5.   

    不好意思发错代码了,更正为:
      <div id="oLayer" style="position:absolute;left:30;top:60;z-index:2;background:green;width:120px;height:70px"></div>
    <script type="text/javascript">
    document.write(new Array(100).join("<br>"));
    var init_pos=oLayer.style.posTop;function eee(){  
         if(window.event)
        {oLayer.style.posTop=document.body.scrollTop+init_pos;}
       else
       {document.getElementById('oLayer').style.position="fixed";}
       
    }
    window.onscroll = eee;  
    </script>