Jump to content
Search Community

ScrollTrigger: Inside a demo-example -> what is the purpose of that certain variable?

beenjamin
Moderator Tag

Go to solution Solved by mvaneijgen,

Recommended Posts

beenjamin
Posted

Looking at the demo "Image comparison on scroll" from this page
what is that last variable (zero) in the last "fromTo" at the very end?

image.png.57a70c5421c7d8897a16259a7e8fe63b.png

i could not find any hints in the docs.

Appreciate any help, thanks a lot!

See the Pen oNjgEjm?editors=1100 by GreenSock (@GreenSock) on CodePen.

  • Solution
mvaneijgen
Posted

Hi @beenjamin welcome to the forum!

 

That is the position parameter and it is used to time tweens on a timeline. This 0 in particular states "put this tween at the 0 mark of the whole timeline", eg at the start of the timeline. Just as a note setting "<" would do the same thing in this case, this helper states "start this tween at the same time as the previous tween". 

 

If you're interested in what all is possible with GSAP take a look at our awesome getting started guide https://gsap.com/resources/get-started/ teaches you all the basics. 

 

 

Hope it helps and happy tweening! 

  • Like 2

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