我正在尝试修改一个名为fullpage.js的库,以便在动画发生时将每个动画步骤的值输出到控制台。
这是管理动画的实际函数:
$(scrolledElement).animate(scrollOptions, options.scrollingSpeed, options.easing, function () {
continuousVerticalFixSectionOrder();
$.isFunction(options.afterLoad) && !localIsResizing && options.afterLoad.call(this, anchorLink, (sectionIndex + 1));
setTimeout(function () {
isMoving = false;
$.isFunction(callback) && callback.call(this);
}, scrollDelay);
});
我的步进函数将是这样的:
step: function(){
var currentTop = $("#superContainer").offset().top;
console.log( "Left: ", currentTop );
};
我尝试了很多组合,但仍然没有猜到在不破坏代码的情况下将它放在哪里。
抱歉打扰,我想这是一个菜鸟问题,但我花了 4 个小时在上面没有结果。感谢大家!
阿基尔