js页面滑到底部触发事件
来源:互联网 发布:unix网络编程卷2 编辑:程序博客网 时间:2024/06/14 20:43
function getScrollTop(){ 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; return scrollTop;}//文档的总高度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; return scrollHeight;}//浏览器视口的高度function getWindowHeight(){ var windowHeight = 0; if(document.compatMode == "CSS1Compat"){ windowHeight = document.documentElement.clientHeight; }else{ windowHeight = document.body.clientHeight; } return windowHeight;}window.onscroll = function(){ if(getScrollTop() + getWindowHeight() == getScrollHeight()){ moreReconmend();//console.log("getScrollTop:"+getScrollTop()+"**getWindowHeight:"+getWindowHeight()+"**getScrollHeight:"+getScrollHeight()) }};
阅读全文
0 0
- js页面滑到底部触发事件
- [Js]判断iframe内的页面是否滚动到底部触发事件
- Jquery/js 页面滚动到底部事件
- js实现滚动条滚动到最底部触发事件
- js监听页面的scroll事件,当移到底部时触发事件
- HTML 页面滑到最底部,触发事件
- js控制html页面滚动条到底端触发事件
- jquery滚动条到底部触发事件
- angularJS-滚动到底部触发事件
- js页面加载触发事件
- js实现移动HTML5页面滑动到最底部触发内容加载
- js监听页面到底部
- css 滚动条滑动到底部时触发事件
- 移动端网页滑动到底部触发事件
- 关于页面滑动到底部的事件
- js 打开(关闭)页面触发事件
- js页面加载之前触发的事件
- js/jquery控制页面滑动到底部时自动加载事件
- 深入浅出 消息队列 ActiveMQ
- Servlet生命周期与工作原理
- NandFlash---地址与区、块、页的关系-以MX30LF1G08AA为例
- 像差——畸变
- 有道云笔记快捷键使用指南
- js页面滑到底部触发事件
- 【源码】Tomcat源码偷窥
- 制作html邮件的注意要点
- Enhancer云开发平台发布了!打开浏览器写 SQL 做配置就能一站完成系统开发
- Linux下全局安装composer方法
- 3ds Max 打开文件未响应的解决办法
- harbor1.2.0安装
- 搭本地服务器
- 292. Nim Game