码迷,mamicode.com
首页 > Web开发 > 详细

jquery实现上拉加载更多

时间:2017-07-17 20:25:53      阅读:288      评论:0      收藏:0      [点我收藏+]

标签:vue   otto   load   ati   doc   bsp   iss   read   cli   

 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实现上拉加载更多

标签:vue   otto   load   ati   doc   bsp   iss   read   cli   

原文地址:http://www.cnblogs.com/summer0319/p/7197036.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!