日期:2014-05-16  浏览次数:20379 次

求教加载更多的效果着呢么做啊
加载更多的效果怎么做啊,就是会自动加载下一页的文章内容到首页而不用翻页来看那样子的,有没有直接用的什么代码或者插件之类的,新手不懂。

------解决方案--------------------
是直接改变div的值吗?不很明白你的意思
------解决方案--------------------
<!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 type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
</head>
<body > 
<div id="divId" style="background:#f00; height:1000px; overflow:hidden;">
    <div style="height:1500px;"></div>
</div>
<script type="text/javascript">
    window.onscroll = function () {
        var a = document.documentElement.scrollTop == 0 ? document.body.clientHeight : document.documentElement.clientHeight;
        var b = document.documentElement.scrollTop == 0 ? document.body.scrollTop : document.documentElement.scrollTop;
        var c = document.documentElement.scrollTop == 0 ? document.body.scrollHeight : document.documentElement.scrollHeight;
  
  
        if (b != 0) {
            if (a + b == c) {
                showmore();
            }
        }
    }
    function showmore() {
        //alert($('#divId div:last-child').offset().top + parseInt($('#divId div:last-child').height()));
        if(parseInt($('#divId').height()) < ($('#divId div:last-child').offset().top + parseInt($('#divId div:last-child').height()))) {
            $('#divId').css('height', '+=100px');
        }
         
        }
</script>
  
  
</body>
</html>
------解决方案--------------------
ajax动态刷新
------解决方案--------------------
jquery就可以实现 ajax动态修改html的内容 如果想要更好的用户体验的话 可以添加一点动画的效果什么的 
------解决方案--------------------
我觉得应该 是不断 向下 加载吧.

是读取 二级页面内容 到首页?

为什么要这么做?