H5 分页下拉加载事件

$(window).scroll(
		function() {
            //页面总高度
			var scrollHeight = $(document).height();
			//已经滚动到上面的页面高度
			var scrollTop = $(this).scrollTop();
			//浏览器窗口高度
			var windowHeight = $(this).height();
			//此处是滚动条到底部时候触发的事件,在这里写要加载的数据,或者是拉动滚动条的操作
			if (scrollTop + windowHeight == scrollHeight) {
		           //这里就是拉到了最底下,发请求获取下一页
			}
	});

猜你喜欢

转载自18810098265.iteye.com/blog/2372405