Jump to content
GreenSock

Melcarthus

Sequence chidren in parent divs

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 new to greensock, and I realy like it sofar.

 

Here is my problem.

 

I have 2 div.product's and inside are 2 children, one needs to animate to the lef and one needs to animate to the right.

I want this to happen for every .product div , but in sequence. Right now the animation starts with both the .left divs, and after that the .right divs start to animate.

Is it possible to index the .product divs? and iterate over each one, no matter how many .products div there are? I would like to stagger them in sequence but I can't figure it out and I hope I'm explaining myself right...

See the Pen BwNbwp by anon (@anon) on CodePen

Link to comment
Share on other sites

Hi @Melcarthus :)

 

Welcome to the forum. If I understand your question correctly, you want them to do this?

 

See the Pen veOPMK by PointC (@PointC) on CodePen

Does that help? Happy tweening.

:)

  • Like 3
Link to comment
Share on other sites

@PointC yes that is what I was aiming for. Thanks for the quick reply!

 

Is it also possible to start the second tween/timeline a little before the first one ends?

 

Again thanks!

Link to comment
Share on other sites

Sure. You just need to change the stagger number. My demo has it set to 1, but you can drop it down as low as you like. Something like 0.25 maybe?

See the Pen KXpYgr by PointC (@PointC) on CodePen

 

Adjust to your liking. Happy tweening.

:)

  • Like 2
Link to comment
Share on other sites

So awesome,

 

Im starting to get the hang of of the simple stuff. forgetting sometimes to think in timelines and positions instead how I use to do things. Really great!

 

Thanks again. 

  • Like 1
Link to comment
Share on other sites

You're welcome. That's how we roll in the GreenSock neighborhood. ;)

 

Let us know if you have additional GSAP questions. Happy tweening. 

:)

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