Jump to content

Search In
  • More options...
Find results that contain...
Find results in...

OnUpdate not called when pause change the playhead

Recommended Posts

Open my codepen and click anywhere in the frame. It sets the progress to 0.99999 which trigger onUpdate fine, then it pauses at 0 and in this case the onUpdate not called, but I think it should as the background color changed back to red. If pause changes CSS properties then it should give an onUpdate callback too, don't you think? So with this, I'm unable to get my custom property when the playhead sets with pause.


This works fine:


See the Pen MoeqmP?editors=0010 by anon (@anon) on CodePen

Link to comment
Share on other sites

Thanks for the demo. If I understand correctly you just need to set the suppressEvents parameter in the pause() function to false.

Check the docs for an explanation: https://greensock.com/docs/#/HTML5/GSAP/TimelineLite/pause/


Doing this:


  tl.progress(0.9999).pause(0, false);


will force the onUpdate to fire for the progress() and pause() and log:




See the Pen MoePBy?editors=1011 by GreenSock (@GreenSock) on CodePen


  • Like 3
Link to comment
Share on other sites

Thank you Carl and sorry that I missed it in the doc :)

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.