rt,看微博的时候发现,腾讯最下面的翻页分为传统的页码翻页和滚动翻页,滚动的是:在滚动条快移动到底部的时候(这个JS算什么事件),加载下面的内容。然后再移动到下面,再加载。
感到很新鲜,昨天在酷狗7中也发现了这个功能,请教下这个具体如何实现。
我的思路是(滚动条达到一定位置,然后触发ajax,获取下一页的信息,将信息加到div中)但具体如何,还望高手指点。

解决方案 »

  1.   

    http://topic.csdn.net/u/20101206/23/8950499a-9280-4581-a2df-9205a03673aa.html
      

  2.   


    <!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></title>
        <script src="../demo/jquery-1.3.2.min.js" type="text/javascript"></script>
    </head>
    <body style="height:2800px;">
    *DIV开始固定在一个位置,当下拉条下拉的高度超过这个DIV 1px的时候,这个DIV变浮动*
    <div id="top" style="position:fixed; top:50px; left:50px;">
        
    </div>
    <div id="pan" style="width:160px; height:300px; border:dashed 1px black; position:absolute; right:0px; top:300px;">
        
    </div>
    <script type="text/javascript">
        $(document).ready(function () {
            window.onscroll = function () {
                var t = $(document).scrollTop();
                document.getElementById("top").innerHTML = t;            if (t > 301) {
                    //当滚动条下拉到一定位置(301)时,怎么怎么地。                
                    $("#pan").css({ "position": "fixed", "top": "0" });
                }
                else {
                    $("#pan").css({ "position": "absolute", "top": "300" });
                }        }
        });
    </script>
    </body>
    </html>希望对你有点启示,ajax你应该会吧?