Hello everyone, I hope this is a simple question: Is it possible to jump/scroll to animations that are linked to ScrollTrigger (scrubbed)?
With ScrollTrigger.scroll() I can't use timeline labels (like with Timeline.tweenTo()), ScrollToPlugin doesn't work either.
Any ideas?
I see. So you are wanting to scroll to a certain point in a scrubbed ScrollTrigger animation. Using your approach, the position would be off after the link click.
You just have to calculate the position of that label in the Scroll Trigger's offset:
gsap.utils.toArray("nav button.scrollto").forEach(function(a) {
a.addEventListener("click", function(e) {
const percent = tl.labels[e.target.getAttribute("data-jump")] / tl.totalDuration();
const scrollPos = myST.start + (my