Jump to content
GreenSock

Poseidon

Basic question gsap.to()

Go to solution Solved by mvaneijgen,

Recommended Posts

Hello everyone, reading other people code I noticed this effect, it animates and fades the boxes towards top. My question is what "-=0.4" value at the end of this line does?

 

gsap.to(".green", { duration: 0.6, ease: "power2.in", y: -100, opacity: 0, stagger: 0.05 }, "-=0.4");

 

Link to comment
Share on other sites

  • Solution

That is the position parameter.

 

It will do nothing in this case, because there is not a previous tween.  `-=0.4` means it will start 0.4 seconds before the previous tween finishes, `+=0.4` would mean that it starts 0.4 seconds after the previous tween finishes. 

 

Take a look at the learning page for a more in depth explanation and a lot more features. 

  • Like 1
Link to comment
Share on other sites

Thank you!!! :)

 

31 minutes ago, mvaneijgen said:

That is the position parameter.

 

It will do nothing in this case, because there is not a previous tween.  `-=0.4` means it will start 0.4 seconds before the previous tween finishes, `+=0.4` would mean that it starts 0.4 seconds after the previous tween finishes. 

 

Take a look at the learning page for a more in depth explanation and a lot more features. 

 

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