Jump to content
Search Community

Timings with Advanced Staggers

Fakebook 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

While the video about Advanced Staggers was really helpful, I got left with two main questions afterwards.

 

First, how to play the stagger earlier in the animation. In the pen example I'd want it to play 1 second after the previous tween, so I used , "-=4" - however, I'm lead to some confusion with using amount now, since I don't have to specify the the duration between each staggered animation. Previously I would've put something like:

.staggerFrom(".block", 0.8, {opacity:0, y:"50%", ease: Power1.easeOu}, 0.4, "-=4")

 

I'm wondering if something if the correct sort of syntax would be:

 .staggerFrom(".block", 0.8, {opacity:0, y:"50%", ease: Power1.easeOut, stagger: {
    from: "left",
    amount: 2
  }}, 0.4, "-=4")

However, having the additional 0.4 when using the amount: 2 for the timing is a bit confusing. Perhaps setting the 0.4 to null is the correct way? 

 

Finally, when using amount, should I be doing a similar approach with the timing each ease. In my example it's 0.8, should this be set to null as well?

See the Pen mdbRRbZ by fakebooked (@fakebooked) on CodePen

Link to comment
Share on other sites

Hi @Fakebook :)

 

When you use the special advanced stagger property in the vars it will overrule the normal stagger parameter. Here's a fork of your pen in which you can see I just made the stagger parameter 100, but everything works as expected. You can put null in that spot too so your position parameter is correct.

 

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

 

Does that help?

 

Happy tweening.

:)

 

  • Like 2
Link to comment
Share on other sites

Perfect, makes sense and helps!

 

It looks like I was getting confused with amount as well, I was assuming it was the total time of the tweens + the stagger, and not the amount of time for just the staggers to happen.

 

Your example or below works perfectly - thanks! 

 

.staggerFrom(".block", 0.8, {opacity:0, y:"50%", ease: Power1.easeOut, stagger: { from: "left", amount: 2 }}, null, "-=4")

 

  • Like 2
Link to comment
Share on other sites

Happy to help. Sounds like you've got it now. ? You can also use each: instead of amount if you need exact staggering durations for each element.

 

Stay tuned for the next release of GSAP 3.0 when advanced staggering adds some fun new features.  Happy tweening.

:)

 

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