Jump to content
Search Community

stagger array ignores individuell instances

katerlouis 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

Seen in the codepen:

 

As soo as I pass an array as element in a .stagger-Tween, the individual .box'es get ignored and all move as a whole.

.staggerTo(".box", ... // each .box moves! Nice!
.staggerTo([".box", ".box2"], ... // .box'es move as a whole 

// What to do?!

Is there a neat GSAP syntax I do not know about or is the only solution to loop manually?

See the Pen bWBZwa by katerlouis (@katerlouis) on CodePen

Link to comment
Share on other sites

If you're trying to make two groups that stagger their elements at the same time, I'd write it like Manfred did in his fork. If you want the .box and .box2 classes to all be part of of one array, you can write it like this:

TweenMax.staggerTo(".box, .box2", 1, { y: "+=30" }, .2);

Happy tweening.

:)

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