上拉加载触底事件最简单写法

window.addEventListener('scroll', this.handleScroll);

    function handleScroll() {
        //判断滚动到底部
        if ($(window).scrollTop() >=$(document).height() - $(window).height()) {
            console.log(132456)
        }
    }

 

posted @ 2018-06-07 10:48  Basu  阅读(1318)  评论(0编辑  收藏  举报