Jump to content
Search Community

Why is my staggerFrom not working...

flubssen 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

Hey

 

When i am trying to use this, it is running alle the elements at the same time, and with the same cycle.. and I cant figurere out why, and I'm close to getting crazy...

 

<div id="mainHolder">

       <div class="even"></div>

       <div class="odd"></div>

       <div class="even"></div>

       <div class="odd"></div>

       <div class="even"></div>

       <div class="odd"></div>

</div>

 

tl.staggerFrom([".odd"], 0.5, {cycle:{x:[80,-80]}, autoAlpha:0, delay : 2}, 1.3); 

 

Hope that you can help :) 

Link to comment
Share on other sites

Hi @flubssen :)

 

Welcome to the forum.

 

You're targeting an array which contains all the .odd class elements. Since they are all part of the same target, they move together. You'll get the desired behavior by targeting like this:

 

tl.staggerFrom(".odd", 0.5, {cycle:{x:[80,-80]}, autoAlpha:0, delay : 2}, 1.3); 

 

Happy tweening.

:)

 

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