首页 > 代码库 > jquery实现上拉加载更多

jquery实现上拉加载更多

 1 let scrollEvent = ‘scroll.‘ + Date.now();
 2 let touchmoveEvent = ‘touchmove.‘ + Date.now();
 3 SSpa.onModEvents(‘invitation/list‘,{
 4     ready: _=>{
 5         initVue()
 6     },
 7     isShow: _=>{
 8         Vm && Vm.init()
 9         let title = ‘我的邀请‘
10         hybirdApp.setTitle(title)
11         document.title = title
12 
13         let screenH = document.documentElement.clientHeight;
14         function loadMore() {
15             let lastItem = $(Vm.$el).find(‘table‘)[0];
16             let lastBot = lastItem ? lastItem.getBoundingClientRect().bottom : 0;
17             if(lastItem && lastBot-screenH<=0) {
18                 if(Vm.hasNextPage){
19                     Vm.queryDate(Vm.nextPage);
20                 }
21             }
22         }
23         $(document).on(scrollEvent + ‘ ‘ + touchmoveEvent, window.Util.debounce(function(){
24             if(Vm.hasNextPage){
25                 loadMore();
26             }
27         }));
28 
29     }
30 })

 

jquery实现上拉加载更多