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

Function _nestedScroll

esm/ScrollTrigger.js:2368–2392  ·  view source on GitHub ↗
(_ref5)

Source from the content-addressed store, hash-verified

2366 scroll: 1
2367},
2368 _nestedScroll = function _nestedScroll(_ref5) {
2369 var event = _ref5.event,
2370 target = _ref5.target,
2371 axis = _ref5.axis;
2372
2373 var node = (event.changedTouches ? event.changedTouches[0] : event).target,
2374 cache = node._gsap || gsap.core.getCache(node),
2375 time = _getTime(),
2376 cs;
2377
2378 if (!cache._isScrollT || time - cache._isScrollT > 2000) {
2379 // cache for 2 seconds to improve performance.
2380 while (node && node !== _body && (node.scrollHeight <= node.clientHeight && node.scrollWidth <= node.clientWidth || !(_overflow[(cs = _getComputedStyle(node)).overflowY] || _overflow[cs.overflowX]))) {
2381 node = node.parentNode;
2382 }
2383
2384 cache._isScroll = node && node !== target && !_isViewport(node) && (_overflow[(cs = _getComputedStyle(node)).overflowY] || _overflow[cs.overflowX]);
2385 cache._isScrollT = time;
2386 }
2387
2388 if (cache._isScroll || axis === "x") {
2389 event.stopPropagation();
2390 event._gsapAllow = true;
2391 }
2392},
2393 // capture events on scrollable elements INSIDE the <body> and allow those by calling stopPropagation() when we find a scrollable ancestor
2394_inputObserver = function _inputObserver(target, type, inputs, nested) {
2395 return Observer.create({

Callers

nothing calls this directly

Calls 2

_getComputedStyleFunction · 0.70
_isViewportFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…