📜  滚动后反应负载 - Javascript代码示例

📅  最后修改于: 2022-03-11 15:01:52.907000             🧑  作者: Mango

代码示例1
componentWillMount(){
  window.addEventListener('scroll', this.loadMore);
}

componentWillUnmount(){
    window.removeEventListener('scroll', this.loadMore);
}

loadMore(){
    if (window.innerHeight + document.documentElement.scrollTop === document.scrollingElement.scrollHeight) {
        // Do load more content here!
    }
}