The implementation code is as follows: (JS control code)
1 varLoading =false;2$ (document.body). Infinite (). On ("Infinite",function() {3$ ("#loadingID"). CSS ("Display", "" ");4 if(loading)return;5Loading =true;6SetTimeout (function() {7 varPageno=parseint ($ ("#currPage"). Val (), 10) +1;8 Searchdata (pageno);9Loading =false;Ten}, 1000); One }); A -$ (document.body). Pulltorefresh (). On ("Pull-to-refresh",function(){ -SetTimeout (function(){ the$ ("#tbodyGrid"). HTML (""); -Searchdata (1); - $ (document.body). Pulltorefreshdone (); -},1000); +});
JSP page control Code:
<Divclass= "Weui-pull-to-refresh-layer"> <Divclass= ' Pull-to-refresh-arrow '></Div> <Divclass= ' Pull-to-refresh-preloader '></Div> <Divclass= "Down">Drop-down Refresh</Div> <Divclass= "Up">Release Refresh</Div> <Divclass= "Refresh">is refreshing</Div></Div><Divclass= "Weui-infinite-scroll"ID= "Loadingid" > <Divclass= "Infinite-preloader"></Div>is loading</Div>
The demo has a link below (the decompression password is the file name):
Http://files.cnblogs.com/files/shitou5e/demo.zip
JSP mobile page implementation of pull-down refresh, pull-up loading