Jump to content
Search Community

set delay to TimelineLite?

Vincentccw 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

How do I set animation delay to using timelineLine?

 

I have an animation that store inside slideUpTemplate instance

 

/*========================================*/

var slideUpTemplate = new TimelineLite({
paused:true,
onComplete:animationComplete,
onReverseComplete:animationCompleteRev
});
/*========================================*/
 
I've an button that will hover in and out event attached to it, and call slideUpTemplate.play() and slideUpTemplate.reverse() respectively.
 
My problem is when I hover out I want the animation to delay for 1second before triggering the slideUpTemplate.reverse() method.
 
My initial thought was to use slideUpTemplate.delay(1).reverse() but it only works for the 1st time.....
Link to comment
Share on other sites

Yeah, without seeing an example it sounds like Chrysto's advice is best.

 

You can't tell a timeline to wait to reverse, but you can wait to tell it to reverse.

DelayedCall() simply waits a set amount of time before calling a function.

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