Jump to content
Search Community

Help for stagger

Myows 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

Hi,

 

I cant quite get this right, help would be wonderful (and once my animation is finished, I will gladly contribute a tut to thank the community)

 

How can I stagger 3 elements, each starting 0.5 seconds after the previous. Each element would animate for 1 second, and then once all staggering is complete, my animation pauses.

 

Here's my attempt:

 

tl.staggerFrom ([item1, item2, item3], 1, {css:{top:-200}, ease:Bounce.easeOut, onComplete: pause}, 0.5, 2);

 

but with that, the pause occurs when the first element has finished it's tween (I'd like the pause to happen when the 3rd has finished)

 

Many thanks in advance

Link to comment
Share on other sites

your onComplete is being applied to each tween in the staggerFrom(). staggerFrom()'s 7th parameter is onCompleteAll which I believe is what you want:

 

http://api.greensock.com/js/com/greensock/TimelineLite.html#staggerFrom()

 

tl.staggerFrom ([item1, item2, item3], 1, {css:{top:-200}, ease:Bounce.easeOut}, 0.5, 2, null, pause);

 

note if you don't want to get hung up on managing 7 parameters, you could also just use append() or call() right after the staggerFrom()

 

tl.staggerFrom ([item1, item2, item3], 1, {css:{top:-200}, ease:Bounce.easeOut}, 0.5, 2);
tl.append(pause);

//if you need to pass in params or scope use call
tl.call(pause, [param1, param2], someScope);

 

lots of options. hope this helps.

 

-c

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