Ideas:
By capturing the browser scroll bar Drop-down event, the JS method of asynchronous loading data is triggered, and the data is dynamically added.
Script:
The Var lastid=0;//records the last record ID at the time of each load, related to how you sort.
var isloading = false;
$ (window). Bind ("scroll", function () {
if ($ (document). ScrollTop () + $ (window). Height ()
> $ (document). Height ()-&&!isloading) {
isloading = true;
Getmore ();
}
);
function Getmore () {
var url = "ajaxdata.aspx"? lastid= "+ LastID + &type=" + other parameter
$.getjson (URL, function (d ATA) {
var html= "";
... ...
$ (HTML). InsertAfter ($ (". Elem"). Last ());
IsLoading = false;
}
}
This jquery implementation of the scroll bar under the infinite load of a simple example is a small series to share all the content, hope to give you a reference, but also hope that we support the cloud habitat community.