如题,在线等》。速度求

解决方案 »

  1.   

      我就是不想用滚动条,当div的内容高度大于div本身高度时,增加一倍div的高度,但显示的内容应该是190px到380px的内容,而0至190px的内容隐藏,最好是用jquery产生动画滑动效果
      

  2.   


    <script type='text/javascript' src='jquery-1.4.2.min.js'></script>
    <div id="div1" style="width:100px;height:200px;overflow:hidden;">
        <div id="div2" style="width:100px;">文字内容文字内容文字内容文字内容文字内容文字内容文字内容文字内容文字内容文字内容文字内容文字内容文字内容文字内容文字内容文字内容文字内容文字内容文字内容文字内容文字内容文字内容文字内容文字内容文字内容文字内容文字内容文字内容文字文字内容文字内容文字内容文字内容底部底部底部底部底部底部底部底部底部底部底部底部底部</div>
    </div>
    <script>
    var height=0;
    var n=10;
    function scroll()
    {
        height+=n;
        $("#div1").scrollTop(height);
    if(height<$("#div2").height()){setTimeout("scroll()",200);}

    }
    scroll();
    </script>