Jump to content
Search Community

4rd argument of .to()

lovezjk test
Moderator Tag

Go to solution Solved by Jonathan,

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

  • Solution

Hello lovezjk, and Welcome to the GreenSock Forum!

 

Are you looking for the position parameter?

 

Here is great video tut by the Mighty Carl on how to use it.

 

Timeline Tip: Understanding the Position Parameter

 

Also look at TimelineMax to() method:

 

http://greensock.com/docs/#/HTML5/GSAP/TimelineMax/to/

 

position : *

  • (default = +=0) — Controls the placement of the tween in the timeline (by default, it's the end of the timeline, like "+=0"). Use a number to indicate an absolute time in terms of seconds (or frames for frames-based timelines), or you can use a string with a "+=" or "-=" prefix to offset the insertion point relative to the END of the timeline. For example, "+=2" would place the tween 2 seconds after the end, leaving a 2-second gap. "-=2" would create a 2-second overlap. You may also use a label like "myLabel" to have the tween inserted exactly at the label or combine a label and a relative offset like "myLabel+=2" to insert the tween 2 seconds after "myLabel" or "myLabel-=3" to insert it 3 seconds before "myLabel". If you define a label that doesn't exist yet, it will automatically be added to the end of the timeline before inserting the tween there which can be quite convenient. Be sure to read our tutorial Understanding the Position Parameter which includes interactive timeline visualizations and a video.

Adds a TweenLite.to() tween to the end of the timeline (or elsewhere using the "position" parameter) - this is a convenience method that accomplishes exactly the same thing as add( TweenLite.to(...) ) but with less code.

 

I hope this helps! :)

  • Like 3
Link to comment
Share on other sites

Awesome job, Jonathan.

 

lovezjk,

 

Definitely study the resources Jonathan gave.

In addition, I want to point out that TweenMax and TweenLite both have a to() method which takes 3 parameters.

TimelineLite and TimelineMax both have a to() method that takes 4 parameters. The 4th parameter (position parameter) in the timeline methods allows you to dictate where the to() tween gets placed in the timeline.

 

Many timeline methods us the position parameter. Once you understand it, you will be a Timeline Master!

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