Jump to content
GreenSock

federicovezzoli

_gsTransform is always undefined

Recommended Posts

Hi, I'm trying to read a scale value of a transform from an element, but I always get undefined.

The selector is simple as that:

document.querySelector(".logo")._gsTransform

I'm using gsap 3.

any idea?

Thanks

Link to comment
Share on other sites

This is a new feature in GSAP3. No more _gsTransform.

 

Quote

 

What old code will definitely break?

  • Anything that references _gsTransform (use the new gsap.getProperty() method instead)
  • Like 2
Link to comment
Share on other sites

As benoit said, you should use getProperty() instead of _gsTransform. It's best to not try to access any _ variables in GSAP (and a general good rule of thumb in JS in general).

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