Jump to content
GreenSock

xxboonexx

Cycle the animation length of a staggerTo?

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

Hey everyone, is there a way to use cycle on the length of time for a staggerTo?

 

For example, I know this doesn't work, but it may illustrate the effect I am trying to get.

 

TweenMax.staggerFrom([myItem1, myItem2, myItem3], cycle{[1, 2, 3]}, {rotation:90}, 1);
 
I'm trying to adjust the length of time each item is animated over, myItem1 would take 1 second, myItem2, would take 2 second, etc.
 
Thanks in advance for any help.
 
Link to comment
Share on other sites

Hi xxboonexx :)

 

I'd recommend using jQuery each() for something like that. When you have access to the index value, you can use it to control duration, delay, etc. as well as part of the animation calculations too.

 

Please take a look at this simple example to get started.

 

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

 

Hopefully that helps a bit.

 

Happy tweening.

:)

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