Jump to content
Search Community

How to animate child elements after their respective parent elements had been staggered and NOT after all parent elements had been staggered

bignose 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

I'm pretty new with GSAP, and currently in a bit of a pickle. I would really appreciate any help. I'm trying to staggerFrom 10 image containers, however each container has a child image. I need to autoAlpha each image AS SOON as its respective parent has been animated and NOT after all 10 image containers had been animated. 

 

.staggerFrom("grid-item", 1, { y:-10, ease: Back.easeIn }, 0.3)
.from("grid-item img", 1, {autoAlpha:0, ease: Back.easeIn }, 0.3)

 

Thank you!

Link to comment
Share on other sites

Hi @bignose :)

 

Welcome to the forum and thanks for joining Club GreenSock. 

 

If I understand your question correctly, you'd want to use the position parameter on the autoAlpha stagger tween. Your first stagger duration is 1 second so you can set a position parameter of 1 second on the autoAlpha stagger and it will start when the first element in the first stagger tween completes.

 

tl.staggerFrom("grid-item", 1, { y:-10 }, 0.3);
tl.from("grid-item img", 1, {autoAlpha:0 }, 0.3, 1);

 

More info about the position parameter:

https://greensock.com/position-parameter

 

Hopefully that helps. Happy tweening and welcome aboard.

:)

 

  • Like 3
Link to comment
Share on other sites

Thanks Craig! Although, I was able to read  and watch tutorials about positioning parameters before, it turns out that my animation offsets were a bit off.  I'm still getting the hang of it. Thanks again, and GSAP is fantastic.

  • 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.
×
×
  • Create New...