burocratik Posted June 4, 2020 Posted June 4, 2020 How to update the timeline values now? Imagine a scenario that you have a box moving in the x axis, and when you scroll you stop the auto animation and move it with scroll value, and when you stop scrolling it updates de current value and resume the timeline again. In the previous version timeline.update did that pretty well
ZachSaucier Posted June 4, 2020 Posted June 4, 2020 Hey burocratik and welcome to the GreenSock forums. Thanks for supporting GreenSock by being a Club GreenSock member! I would likely do this sort of thing by affecting the timeline's .progress() on scroll. When the page is scrolled, pause the animation and update it as needed using the .progress(). In the last scroll event, set a .delayedCall() that resumes the timeline. See the Pen gOPbPNR?editors=0010 by GreenSock (@GreenSock) on CodePen. Instead of just pausing and resuming you could set or animate the timeline's timeScale instead if you'd like
burocratik Posted June 4, 2020 Author Posted June 4, 2020 1 hour ago, ZachSaucier said: Hey burocratik and welcome to the GreenSock forums. Thanks for supporting GreenSock by being a Club GreenSock member! I would likely do this sort of thing by affecting the timeline's .progress() on scroll. When the page is scrolled, pause the animation and update it as needed using the .progress(). In the last scroll event, set a .delayedCall() that resumes the timeline. Instead of just pausing and resuming you could set or animate the timeline's timeScale instead if you'd like Thanks Zach!
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