Jump to content
GreenSock

KevinJ

Pause (for x secs) timeline then play in reverse

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

Hi All,

 

I'm sure this has been asked before but I can't find a similar solution.

 

In the pen above I'm triggering an animation on a button click. Rather than having the close button reverse the animation, I'd like it to pause for a set time and then animate out.

 

I was playing with it yesterday but getting some weird results.

 

KJ

See the Pen qyBpjE by kjames (@kjames) on CodePen

Link to comment
Share on other sites

If I understand your questions correctly, I would think a delayedCall would work well.

 

See the Pen ZjJwdP by PointC (@PointC) on CodePen

 

Does that help?

 

Happy tweening.

:)

 

  • Like 2
Link to comment
Share on other sites

3 hours ago, PointC said:

If I understand your questions correctly, I would think a delayedCall would work well.

 

See the Pen ZjJwdP by PointC (@PointC) on CodePen

 

Does that help?

 

Happy tweening.

:)

 

Hi Craig,

 

Thanks for responding. Sorry for not being clear. I want to remove the close button completely and have the message show for 5 secs the it reverses playback. 

Link to comment
Share on other sites

ahh... o.k. I thought that was a bit odd clicking a close button and adding a delay. I get it now.

 

In that case, I would just add that delayed call to the #ylw-btn handler and set the delay equal to the tl.duration() + 5. Something like this maybe.

 

See the Pen ZjXzoq by PointC (@PointC) on CodePen

Does that help?

 

Happy tweening.

:)


 

  • Like 2
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.
×