Share Posted January 31, 2021 Hello everyone, I have have a timeline controlled with ScrollTrigger and inside I have some labels. So I have some methods that do a tweenFromTo from one label to another, but then of course If I start scrolling again I restart from the last ScrollTrigger progress. Is it possible to update the scrollTrigger progress value to the actual timeline time that occurs at the end of tweenFromTo? Recap: I have a timeline. Timeline is controlled with ScrollTrigger. Timeline has 3 different labels (label1, label2, label3). If i do timeline.tweenFromTo("label1", "label2") everything is fine. But then if I restart scrolling i restart from the last ScrollTrigger progress value. Is it possible to update the timeline.ScrollTrigger value so If i Scroll I start from the end of timeline.tweenFromTo("label1", "label2")? Thanks Link to comment Share on other sites More sharing options...
Author Share Posted January 31, 2021 I'm unsing ScrollToPlugin. So I have a timeline with different labels. Is it possible to scroll to the actual label position?? I set up a method: timelinePlanets is my timeline. function scrollToLabel(labelName){ const pos = Math.ceil(document.body.scrollHeight * (timeLinePlanets.labels[labelName] / timeLinePlanets.duration()) ) TweenMax.to(window, { duration: 2, scrollTo: pos, ease: 'power1.inOut' }) } Link to comment Share on other sites More sharing options...
Solution Author Solution Share Posted January 31, 2021 Solved with this: 2 Link to comment Share on other sites More sharing options...
Share Posted February 1, 2021 I'm glad you got it figured out. Side note: We highly recommend upgrading to GSAP 3 and using the newer, sleeker syntax! It's easy to upgrade. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now