MCPcopy
hub / github.com/greensock/GSAP / onComplete

Method onComplete

src/ScrollTrigger.js:710–719  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

708 data: _abs(endScroll - scroll), // record the distance so that if another snap tween occurs (conflict) we can prioritize the closest snap.
709 onInterrupt: () => snapDelayedCall.restart(true) && onInterrupt && _callback(self, onInterrupt),
710 onComplete() {
711 self.update();
712 lastSnap = scrollFunc();
713 if (animation && !isToggle) { // the resolution of the scrollbar is limited, so we should correct the scrubbed animation's playhead at the end to match EXACTLY where it was supposed to snap
714 scrubTween ? scrubTween.resetTo("totalProgress", endValue, animation._tTime / animation._tDur) : animation.progress(endValue);
715 }
716 snap1 = snap2 = animation && !isToggle ? animation.totalProgress() : self.progress;
717 onSnapComplete && onSnapComplete(self);
718 onComplete && _callback(self, onComplete);
719 }
720 }, scroll, change1 * change, endScroll - scroll - change1 * change);
721 onStart && _callback(self, onStart, tweenTo.tween);
722 }

Callers

nothing calls this directly

Calls 5

resetToMethod · 0.80
totalProgressMethod · 0.80
_callbackFunction · 0.70
updateMethod · 0.45
progressMethod · 0.45

Tested by

no test coverage detected