时间:2021-07-01 10:21:17 帮助过:50人阅读
实例如下所示:
- $(document).on("scroll", function () {
- //真实内容的高度
- var pageHeight = Math.max(document.body.scrollHeight, document.body.offsetHeight);
- //视窗的高度
- var viewportHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight || 0;
- //隐藏的高度
- var scrollHeight = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0;
- //判断加载视频,文章,回答,医生
- if(pageHeight - viewportHeight - scrollHeight <=0){
- //事件
- }
- });
相关推荐:
jquery回车键触发事件实现方法
js如何实现鼠标悬停一定时间后触发事件
jquery:delegate重复触发事件问题的解决办法
以上就是判断滚动条滑到底部触发事件实例分享的详细内容,更多请关注Gxl网其它相关文章!