当前位置: 移动技术网 > IT编程>开发语言>JavaScript > 判断滚动条滑到底部触发事件(实例讲解)

判断滚动条滑到底部触发事件(实例讲解)

2017年11月17日  | 移动技术网IT编程  | 我要评论

实例如下所示:

$(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){
  //事件
 }
});

以上这篇判断滚动条滑到底部触发事件(实例讲解)就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持移动技术网。

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网