Jump to content
Search Community

Manipulating the duration of each tween in a StaggerTo

hopekim511 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

Hi hopekim511  :)

 

Welcome to the GreenSock forums.

 

The stagger methods are used to create the same animation for each element (or different using cycle) and offset their start times. I don't think there is a way to use cycle for the duration. You'd be able to accomplish your goal with a loop and then use the index to create incremental or random values for the animation. Something like this:

$(".box").each(function(i, element){
  TweenMax.to(element, i + 0.5, {x: (i+1) * 100, delay: i * 0.1})
})

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