Jump to content
Search Community

Timelinelite docs to() typo?

Vince 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

Hi guys,

 

Just getting upto speed with the new syntax methods of v12 (I know its not so new now!)

 

Does the to() method example in the timelinelite docs have a typo or am I misunderstanding the example? Line 7, opacity 0 // comment says 0.5


//create a timeline that calls myFunction() when it completes
var tl = new TimelineLite({onComplete:myFunction});

//now we'll use chaining, but break each step onto a different line for readability...
tl.to(element, 1, {left:100}) //tween element's "left" property to 100
.to(element, 1, {top:50}, "-=0.25") //then tween element's "top" property to 50, starting 0.25 seconds before the previous one ends
.set(element, {opacity:0}) //then set element's opacity to 0.5 immediately
.call(otherFunction) //then call otherFunction()
.staggerTo([e1, e2, e3], 1.5, {rotation:45}, 0.25); //finally tween the rotation of e1, e2, and e3 to 45 and stagger the start times by 0.25 seconds
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...