Jump to content
Search Community

Scaling

SpaceMoney-01011000 test
Moderator Tag

Recommended Posts

Welcome to the forums, @SpaceMoney-01011000

 

There isn't documentation specifically about scaling (well, beyond some generic info about transforms in the CSSPlugin docs). That's because GSAP can animate literally any property of any object that JavaScript can touch. It's not limited to a pre-defined list of properties. It's a high-speed property manipulator. 

 

That being said, here's basic info assuming you're scaling DOM elements: 

  • You can animate "scale", like: 
    gsap.to(".target", {scale: 2, duration: 1.5});

     

  • You can animate scaleX or scaleY to independently control scaling on the x-axis or y-axis:
    gsap.to(".target", {scaleX: 2, scaleY; 0.5, duration: 1});

    (when you animate "scale" it's just a shortcut for animating BOTH scaleX and scaleY to the same value)

  • It's always best to set any transform-related data directly via GSAP. We explain why here

Happy tweening!

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