Jump to content
Search Community

Delay an entire label

Marshmallow test
Moderator Tag

Go to solution Solved by Dipscom,

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,

 

I am (still) working on a big animation and am currently transferring all to a timeline because I didn't do so before. I now have three labels. 'titleOut', 'slideMoves' and 'titleIn' and I want everything with the label 'slideMoves' to start 0.5 seconds earlier instead of waiting till 'titleOut' is finished.

 

Is there a way to specify that without adiing '-=0.5' to every single object?

 

Thanks

 

~Marshmallow

Link to comment
Share on other sites

Yup, Dipscom is exactly right, you can just move the label and anything placed at that label will go in the proper spot.

 

If you have a complex animation and you don't want to specify the label in every tween, you can put a group of animations in a timeline and then just place the whole thing wherever you want in a parent timeline like:

 

//all things
var main = new TimelineMax({repeat:10, repeatDelay:0.3})
main.staggerTo(".green", 1, {y:200}, 0.5)
main.add("childTimelineGoesHere", 1) //put this label wherevers


//orange things
var child = new TimelineMax()
child.to(".orange.first", 1, {y:100})
child.to(".orange.second", 1, {y:200})
child.to(".orange", 1, {scale:0.5}, 1)


//put child in main at label
main.add(child, "childTimelineGoesHere");

http://codepen.io/GreenSock/pen/Mbxexx

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