页面滚动到底部加载内容

2019-04-10  本文已影响0人  Gino_Li
1554696748(1).png
原理:

scrollTop+clientHeight>=scrollHeight

var scrollTop = document.documentElement.scrollTop,
      clientHeight = document.documentElment.clientHeight,
      scrollHeight = document.documentElement.scrollHeight;

if(scrollTop+clientHeight>=scrollHeight){
      //进行ajax请求
}
上一篇 下一篇

猜你喜欢

热点阅读