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

Function _getLabelRatioArray

esm/ScrollTrigger.js:201–212  ·  view source on GitHub ↗
(timeline)

Source from the content-addressed store, hash-verified

199 return element["offset" + d2] || element["client" + d2] || 0;
200},
201 _getLabelRatioArray = function _getLabelRatioArray(timeline) {
202 var a = [],
203 labels = timeline.labels,
204 duration = timeline.duration(),
205 p;
206
207 for (p in labels) {
208 a.push(labels[p] / duration);
209 }
210
211 return a;
212},
213 _getClosestLabel = function _getClosestLabel(animation) {
214 return function (value) {
215 return gsap.utils.snap(_getLabelRatioArray(animation), value);

Callers 2

_getClosestLabelFunction · 0.70
_getLabelAtDirectionFunction · 0.70

Calls 1

durationMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…