Jump to content
Search Community

where would I find docs for "final"

Guest Vic_
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

Hi,

I'm studying linked code pen, I see:

 .set($panel3,   { top:0}, "final")
 .to($panel2, 0.4, { y:-60}, "final+=0.1")
 
and to learn "final" and "final+=0.1"
but no joy.
 
What is  "final" and "final+=0.1" and where is it documented please.
 
Cheers,
Vin
ps: also removing "final" in the entire project does not appear to change anything.

See the Pen Fqmsa by GreenSock (@GreenSock) on CodePen

Link to comment
Share on other sites

The string "final" is being used as a label in the position parameter in the timeline. It could also have been an absolute time (just a number, say 2) or a relative time in the timeline (a string like "+=1"). You can also have a combination of label and relative time, as seen in "final+=0.1" - That is saying: Add this tween 0.1 second after the label "final".

 

So, what you are looking for is not "final" but to understand the position parameter and labels in GSAP.

 

Here's Dr. Schooff explaining the position parameter.

 

http://greensock.com/position-parameter

 

Finally, note that you don't have to use the .add() method to create a label to use as a position parameter. You can simply add the label at the tween you desire and if this label has not been defined before in that timeline, GSAP will create the label at that point in time, just like in the example Pen you have been studying.

 

Have a read here for a lot of info on how GSAP's timeline works.

 

http://greensock.com/docs/#/HTML5/Sequencing/TimelineLite/

 

Happy Tweening! :)

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