function Refresh (refresh,loadmore) {
$ (window). Scroll (function () {
Console.log (' sliding f ');
var scrolltop = $ (this). ScrollTop (); Height of scroll bar from top
var scrollheight = $ (document). Height (); The total height of the current page
var clientheight = $ (this). Height (); The currently visible page height
Console.log ("Top:" +scrolltop+ ", Doc:" +scrollheight+ ", Client:" +clientheight ");
if (scrolltop + clientheight >= scrollheight) {//distance top + current Height >= The total height of the document represents sliding to the bottom count++;//sliding count plus 1 per slide
Filterdata (Servicetypeid,industryid,cityid,count); Call the filter method, count is the current number of pages
Console.log (' drop down ');
if (Loadmore) {
Loadmore ();
}
}else if (scrolltop<=0) {
The height of the scroll bar distance from the top is less than or equal to 0 TODO
Alert ("Drop-down refresh, what method to call in this?") ");
Console.log (' pull-up ');
if (refresh) {
Refresh ();
}
}
});
}
var fn1,fn2;
Refresh (FN1,FN2);
Original: https://www.cnblogs.com/handsomeBoys/p/6557839.html
JS Mobile drop-down refresh, pull-up load more.