Jump to content
Search Community

timeline.update() is not a function anymore

burocratik test
Moderator Tag

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

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