本文主要为大家带来一篇判断滚动条滑到底部触发事件的实例讲解。具有很好的参考价值。一起跟随小编过来看看吧,希望对大家有所帮助,希望能帮助到大家。
实例如下所示:
$(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重复触发事件问题的解决办法
以上就是判断滚动条滑到底部触发事件实例分享的详细内容。