A simple example of infinite loading when jquery implements scroll bar drop-down

var lastId=0; //记录每一次加载时的最后一条记录id,跟您的排序方式有关。
 
   var isloading = false ;
   $(window).bind( "scroll" , function () {
     if ($(document).scrollTop() + $(window).height()
 
        > $(document).height() - 10 && !isloading) {
       isloading = true ;
       getMore();
     }
   });
 
 
 
function getMore() {
     var url = "ajaxdata.aspx" ?lastId= " + lastId +" &type= " + 其他参数
     $.getJSON(url, function (data) {
       var html=" ";
 
        ... ...
 
       $(html).insertAfter($(" .elem").last());
       isloading = false ;
     }
 
   }

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326912680&siteId=291194637