Capítulo 373 de 411
Sorts the internal Array of ScrollTrigger instances to control the order in which they refresh() (calculate their start/end values).
ScrollTrigger.create({
refreshPriority: -1, // lower priority makes it happen later in the refresh() calculations
...
});
ScrollTrigger.create({
... // if no refreshPriority is defined, it defaults to 0
});
gsap.to(".class", { // works with tweens/timelines too
opacity: 1,
scrollTrigger: {
refreshPriority: 3, // a higher number makes it happen earlier in the refresh() calculations
...
}
});
ScrollTrigger.sort(); // use the defaults (typically best)
// or use a custom function...
ScrollTrigger.sort((a, b) => a.start - b.start);