Jump to content
Search Community

On Reverse Complete Delay?

valente97 test
Moderator Tag

Go to solution Solved by Carl,

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

Hello I don't know if its possible to do but, i wanted to know if i could add a delay to the 'onReverseComplete' ?

 

the way i have it is 

var menuOpen = new TimelineMax({paused: true, onReverseComplete:menuFinishClose})

and in the function it calls i made it set the width and height using just the standard jQuery .width and .height as a px because using the  .reverse it sets the width in % which i don't want it to.

 

I'd like to have a negative delay because it looks a bit clunky the way it jumps back after the animation is done

 

Any help on this is much appreciated :)

Link to comment
Share on other sites

  • Solution

It's tough to diagnose without a demo but one way would be to make your onReverseComplete fire a delayedCall() like

var menuOpen = new TimelineMax({paused: true, onReverseComplete:wait})

function wait() {
  TweenLite.delayedCall(1, menuFinishClose);
}

You might also be able to just put your first tween at a time of 1 and then pause your timeline at time of 1 like 

menuOpen.pause(1) // where first tween starts. then when you reverse there will be 1 second of dead time between the first tween reversing and the onReverseComplete firing.

  • Like 2
Link to comment
Share on other sites

It's tough to diagnose without a demo but one way would be to make your onReverseComplete fire a delayedCall() like

var menuOpen = new TimelineMax({paused: true, onReverseComplete:wait})

function wait() {
  TweenLite.delayedCall(1, menuFinishClose);
}

You might also be able to just put your first tween at a time of 1 and then pause your timeline at time of 1 like 

menuOpen.pause(1) // where first tween starts. then when you reverse there will be 1 second of dead time between the first tween reversing and the onReverseComplete firing.

 

Thanks Carl :) sorry about not including it, since it was just the delay i didnt think you would need it 

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