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

Function onResize

src/ScrollTrigger.js:1654–1659  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1652 },
1653 tween, startScrollX, startScrollY, onStopDelayedCall,
1654 onResize = () => { // if the window resizes, like on an iPhone which Apple FORCES the address bar to show/hide even if we event.preventDefault(), it may be scrolling too far now that the address bar is showing, so we must dynamically adjust the momentum tween.
1655 updateClamps();
1656 if (tween.isActive() && tween.vars.scrollY > maxY) {
1657 scrollFuncY() > maxY ? tween.progress(1) && scrollFuncY(maxY) : tween.resetTo("scrollY", maxY);
1658 }
1659 };
1660 content && gsap.set(content, {y: "+=0"}); // to ensure there's a cache (element._gsap)
1661 vars.ignoreCheck = e => (_fixIOSBug && e.type === "touchmove" && ignoreDrag(e)) || (scale > 1.05 && e.type !== "touchstart") || self.isGesturing || (e.touches && e.touches.length > 1);
1662 vars.onPress = () => {

Callers

nothing calls this directly

Calls 4

isActiveMethod · 0.80
resetToMethod · 0.80
updateClampsFunction · 0.70
progressMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…