移动网页端滑动到底部加载数据
来源:互联网 发布:excel如何制作数据库 编辑:程序博客网 时间:2024/06/05 06:08
$(window).bind("scroll", function () { var flag=document.getElementById('flag').value; if(getScrollHeight() == getDocumentTop() + getWindowHeight()){ //当滚动条到底时,这里是触发内容 //异步请求数据,局部刷新dom //ajax_function() if(flag==1) { document.getElementById('flag').value=0; alert("滑动到的底部"); } }});//文档高度function getDocumentTop() { var scrollTop = 0, bodyScrollTop = 0, documentScrollTop = 0; if (document.body) { bodyScrollTop = document.body.scrollTop; } if (document.documentElement) { documentScrollTop = document.documentElement.scrollTop; } scrollTop = (bodyScrollTop - documentScrollTop > 0) ? bodyScrollTop : documentScrollTop; console.log("scrollTop:"+scrollTop); return scrollTop;}//可视窗口高度function getWindowHeight() { var windowHeight = 0; if (document.compatMode == "CSS1Compat") { windowHeight = document.documentElement.clientHeight; } else { windowHeight = document.body.clientHeight; } console.log("windowHeight:"+windowHeight); return windowHeight;}//滚动条滚动高度function getScrollHeight() { var scrollHeight = 0, bodyScrollHeight = 0, documentScrollHeight = 0; if (document.body) { bodyScrollHeight = document.body.scrollHeight; } if (document.documentElement) { documentScrollHeight = document.documentElement.scrollHeight; } scrollHeight = (bodyScrollHeight - documentScrollHeight > 0) ? bodyScrollHeight : documentScrollHeight; console.log("scrollHeight:"+scrollHeight); return scrollHeight;}
0 0
- 移动网页端滑动到底部加载数据
- 移动端网页滑动到底部触发事件
- 手机网页端滑动到页面底部执行加载更多
- ListBox 滑动到底部自动加载数据
- android listview滑动到底部加载数据
- ListView滑动到底部加载数据
- 网页滚动到底部自动加载数据
- Android数据分批加载-滑动到底部自动加载列表
- ListBox滑动到底部后自动加载数据
- ListBox滑动到底部后自动加载数据
- scrollview 实现滑动到底部加载更多数据
- ScrollView加载完数据后自动滑动到底部
- recycleview滑动到底部自动加载更多数据
- jq 滑动到底部 加载下一页数据
- jquery实现滑动到底部加载下一页的数据
- ScrollView加载完数据后自动滑动到底部
- 原生javascript移动端滚动到底部加载更多数据效果代码
- 移动端滚动加载数据判断是否滚动到页面底部
- webMethods Publishing delayed while outbound store is draining
- 39个让你受益的HTML5教程
- (十二)Shell编程基础
- 每天一个linux指令——chown
- 371. Sum of Two Integers
- 移动网页端滑动到底部加载数据
- html复习回顾之div用法
- linux下如何用c语言调用shell命令
- Git 常见命令
- 如何配置https站点
- Hibernate的XML和annotation两种方式简单例子
- http
- QTabWidget设置为垂直方向时 实现文本内容为水平方向
- 什么是构造函数注入(Constructor Injection)——一个具体的依赖注入例子