Jump to content
Search Community

timeline .paused() attribute doesn't update?

RoyM test
Moderator Tag

Go to solution Solved by ZachSaucier,

Recommended Posts

  • Solution

Hey roy and welcome to the GreenSock forums.

 

The text doesn't update because you're not telling it to: you call the function to get the value when things are initialized but don't call the method ever again. So it stays on the initial value. You need to create some way of telling it to update.

 

Without using React, I'd create a variable reference to the element whose text should be updated. Then in the playHandler I'd update the text. In React I guess you'd use a ref to do the same thing but I'm not very familiar with React.

Link to comment
Share on other sites

Thanks for that, Zach.. I modified and forked the code as shown here, since my next issue is different than this one.
 - now my issue is that I'm not able to toggle the "paused" state correctly. It keeps zipping back to the beginning and re-running.

Could this be an artifact of using fromTo?

 

https://codesandbox.io/s/busy-hooks-8h5gj?file=/src/DemoApp.css

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