Jump to content
Search Community

How to position two staggerTo to run at the same time?

gimperdaniel 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

Looks like the stagger method doesn't have the "position" option. So the second staggerTo only plays after 5 seconds which is the time of the first stagger. I watched the sequence video, and it helped to understand a lot about how the timeline works. But it doesn't mention how to use two staggerTo together.

var locations = new TimelineMax()

.add(TweenMax.staggerTo($(".something-1"), 5, {width:100, height:100, x:"-=50", y:"-=50", opacity:0, repeat:-1}, 1))
.add(TweenMax.staggerTo($(".something-2"), 5, {width:100, height:100, x:"-=50", y:"-=50", opacity:0, repeat:-1}, 1));

To be honest, I am really struggling with the documentation on the site. Is there a place with more tutorials other than what's found on the main site?

 

I have been using this https://www.greensock.com/asdocs/package-summary.html

It helps to see all the options available, but I learn by example ;)

Link to comment
Share on other sites

Hi gimperdaniel  :)

 

With gap or label you can start tweens at the same time .

 

you can use  label to the timeline, making it easy to mark important positions/times :

http://greensock.com/docs/#/HTML5/GSAP/TimelineLite/addLabel/

 

with labe :

See the Pen sxtkb by anon (@anon) on CodePen

 

with gaps :

See the Pen ytsIi by anon (@anon) on CodePen

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...