Jump to content
Search Community

OnUpdate not called when pause change the playhead

RolandSoos test
Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

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:

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

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:

 

$('html').click(function(){
  tl.progress(0.9999).pause(0, false);
});

 

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

0.999999

0

 

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

 

  • Like 3
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...