Jump to content
Search Community

TweenMax.to OR TweenMax.set

jeff2019 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

Hello,

 

I am discovering GSAP and I did an exercice with TweenMax,

 

And I don't understand why I have to write :

 

TweenMax.set('....', {transformPerspective: xxx});

 

If I write the same thing with TweenMax.to and it don't works ...

 

Can someone tell me when we have to use the 1st one and the 2nd one ?

 

 

Link to comment
Share on other sites

Hey Jeff and welcome to the forums! 

 

The .set method is essentially a .to but with a duration of 0. But it's used to set properties of an element without an animation. It makes sense to use it for a transformPerspective because you don't (usually) want to animate that property. 

 

However, it should work for you if you do TweenMax.to('.foo', 0, {transformPerspective: xxx}); I'm guessing you just forgot the animation duration in the .to call (the second parameter). 

 

Does that help?

 

For more information, check out their docs pages: TweenMax.set and TweenMax.to.

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