scroll连续滚动问题

来源:互联网 发布:扫描仪软件通用版 编辑:程序博客网 时间:2024/06/06 04:39
      let timeoutId        function callback() {            const top = wrapper.getBoundingClientRect().top            const windowHeight = window.screen.height            if (top && top < windowHeight) {                // 证明 wrapper 已经被滚动到暴露在页面可视范围之内了                loadMoreFn()            }        }        window.addEventListener('scroll', function () {            if (this.props.isLoadingMore) {                return            }            if (timeoutId) {                clearTimeout(timeoutId)            }            timeoutId = setTimeout(callback, 50)        }.bind(this), false);

原创粉丝点击