better-scroll 源码的一个疑问

下面这个 是上拉加载的实现方法,当if条件为真时,会触发 回调(this.scroll.trigger(PULL_UP_HOOKS_NAME)),就是没有看明白this.scroll.movingDirectionY一直都是0,是在什么时候变成1的?
还有 this.scroll.maxScrollY 是怎么更新的?

demo地址

`PullUp.prototype.checkPullUp = function (pos) {

        var _this = this;
        var threshold = this.options.threshold;
        if (this.scroll.movingDirectionY === 1 /* Positive */ &&
            pos.y <= this.scroll.maxScrollY + threshold) {
            this.pulling = true;
            // must reset pulling after scrollEnd
            this.scroll.once(this.scroll.eventTypes.scrollEnd, function () {
                _this.pulling = false;
            });
            this.unwatch();
            this.scroll.trigger(PULL_UP_HOOKS_NAME);
        }
    };`
    
    
  
阅读 836
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题