如何做到呢???用dom添加内容,内容多的时候会出现滚动条,但滚动条一直在上面,我想做到的效果是内容增多时,滚动条正动移到最下面,谢谢

解决方案 »

  1.   

    这个功能其实不难的,有个与ScollTop的方法,也有相对的,改改就好了!
      

  2.   

     IE8 和 FF3.6.8 测试通过!<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title> new document </title>
        <meta name="generator" content="editplus" />
        <meta name="author" content="[email protected]" />
        <meta name="keywords" content="" />
        <meta name="description" content="" />
    </head>
    <body>
    <div style="height:800px;width:800px;background-color:red;"></div>
    <script type="text/javascript">
    <!--
    window.scroll(0, document.documentElement.scrollHeight);
    alert(document.documentElement.scrollHeight);
    alert(document.documentElement.scrollTop);
    //-->
    </script>
    </body>
    </html>
    Web 开发常用手册DHTML 参考手册
    http://download.csdn.net/source/308913JScript 语言参考
    http://download.csdn.net/source/308916CCS 样式表中文手册
    http://download.csdn.net/source/304124
      

  3.   

    设置document.documentElement.scrollTop的值即可