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 })

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM