js 判断是否滚动到底部
2017-04-19 16:22
639 查看
$(window).scroll(function(){ var scrollTop = $(this).scrollTop(); //scrollTop() 方法返回或设置匹配元素的滚动条的垂直位置 var scrollHeight = $(document).height(); //整个文档的高度 var windowHeight = $(this).height(); //当前可见区域的大小 if(scrollTop + windowHeight == scrollHeight){ alert('The page has been scrolled to the bottom') } })
当 html,body{width:100%;height:100%;} 绑定在window或者body无法触发onscroll和scroll 即jq和js都不会触发scroll事件!
相关文章推荐
- js判断iframe内的网页是否滚动到底部触发事件
- 原生 JS 判断页面是否滚动到底部
- js判断滚动条是否已到页面最底部或顶部实例-拓展(逐渐-自动下滑滚动)
- [Js]判断iframe内的页面是否滚动到底部触发事件
- js 原生判断内容区域是否滚动到底部
- js判断iframe内的网页是否滚动到底部触发事件
- js 原生判断内容区域是否滚动到底部的实例代码
- js 判断浏览器是否滚动到底部
- js判断html页面是否滚动到了最底部
- js判断滚动条是否已到页面最底部或顶部实例
- 判断ScrollView是否滚动到顶部或底部
- js判断滚动条是否已到页面最底部或顶部实例
- js判断用户是否正在滚动滚动条,滚动条滚动是否停止
- 不同浏览器对document.documentElement和document.body的scrollheight ,scrollTop,clientHeight以及判断滚动条是否滚动到页面最底部 【转载】
- 判断DataGridView滚动条是否滚动到当前已加载的数据行底部
- JS如何判断滚动条是否滚到底部
- winform DataGridView控件判断滚动条是否滚动到当前已加载的数据行底部 z
- Android 记录ListView滚动的位置的三种方法及判断是否滑动到底部
- JS 判断滚动底部并加载更多效果。。。。。。。。。
- JS判断是否到达页面底部