Jump to content
Search Community

How to make elements with the same class appear one after another

DanielLav test
Moderator Tag

Go to solution Solved by GreenSock,

Recommended Posts

Hello! I'm just learning GSAP and my question may seem simple. I have 4 elements with the same class and I want them to appear one after the other in my timeline.

Now I'm trying to make it an array, but they still appear at the same time.

 

Please help me solve what seems to me not a difficult problem. And tell me where I went wrong

 

I attach link to codepen example:

See the Pen ExemGwZ by ProjectDCL (@ProjectDCL) on CodePen

Link to comment
Share on other sites

  • Solution

Welcome aboard, @DanielLav

 

It's actually a lot simpler than you may have expected - just use the "stagger" property: 

See the Pen GRXmPYP by GreenSock (@GreenSock) on CodePen

 

More about staggers: https://greensock.com/docs/v3/Staggers

 

By the way, autoAlpha is exactly the same thing as animating "opacity" but it ALSO toggles the "visibility" property to "hidden" when it hits 0. So you definitely don't need to animate both opacity and autoAlpha. 

 

Happy tweening!

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