移动端下拉加载

/**
* 初始化下拉加载
*/
function scrollInit(){
var bottom = 50;
//下拉加载[待定问题 绑定dom元素不对]
$('#tapContainer').off('scroll').on('scroll',function () {  
 if($('#templateContainer').length < 1){
return;
}
var hei = $('#templateContainer').height() ;
var bodyHei = $(document).height(); 
var offsetTop = Math.abs($('#templateContainer').offset().top);
hei - bodyHei - offsetTop;
if ( bottom > (hei - bodyHei - offsetTop)) {                   
reservation();                  
}   
}); 
}

 

posted @ 2017-08-31 17:55  monkye  阅读(136)  评论(0编辑  收藏  举报