首页 > 移动平台 > 详细

手机页面滚动到底部刷新数据

时间:2017-01-07 00:18:49      阅读:273      评论:0      收藏:0      [点我收藏+]
 1 //滚动到底部加载数据
 2 $(window).scroll(function () {
 3     var scrollTop = $(this).scrollTop();
 4     var elementHeight = $(this).height();
 5     var h1 = scrollTop + elementHeight;
 6     var scrollHeight = document.documentElement.scrollHeight;
//var documentHeight = $(document).height();
7 if (h1 >= scrollHeight) { 8 var pageIndex = $("#hidPageIndex").val(); 9 AppendNews(pageIndex); //加载新数据 10 } 11 });

 

技术分享

 

说明:

document.documentElement.scrollHeight 等效于  $(document).height()

 

手机页面滚动到底部刷新数据

原文:http://www.cnblogs.com/miaosha5s/p/6257480.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!