<!DOCTYPE=html>  
<html>  
<head>  
<script type="text/javascript" src="1/js/jquery-2.1.0.min.js" ></script>
</head>  
<body>  
    <div>下拉加载更多</div>  
    <ul class="main" style="height:700px;overflow:auto;">  
        <li class="child" style='border:1px solid red;margin-top:20px;color:grey;height:800px' ><li>  
    </ul>  
</body>  
<script  type="text/javascript">  
$(document).ready(function(){  
    $(".main").unbind("scroll").bind("scroll", function(e){  
    	
        var sum = this.scrollHeight;  
        console.log(sum)
        if (sum <= $(this).scrollTop() + $(this).height()) {  
            $(".main").append(' <li class="child" style="border:1px solid red;margin-top:20px;color:grey;height:800px" ></li>  ');
        }  
        console.log($(this).scrollTop() + $(this).height())
    });  
});  
</script>  
</html>  

  

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-10-16
  • 2022-02-07
  • 2021-07-08
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-07-06
  • 2021-05-17
  • 2022-12-23
相关资源
相似解决方案