Jump to content
Search Community

Recommended Posts

burocratik
Posted

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

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
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!

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...