Jump to content
GreenSock

joachim

rotation of an element

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

How do I get the current rotation angle of an element ?

 

Link to comment
Share on other sites

If you've animated it with GSAP, you can tap into the _gsTransform object:

yourElement._gsTransform.rotation; //rotation in degrees

It also has properties like x, y, scaleX, scaleY, etc. 

  • Like 4
Link to comment
Share on other sites

Jack already gave you the answer, but here's a little pen to get you started.

 

See the Pen vKOmzq by PointC (@PointC) on CodePen

 

Happy tweening.

:)

  • Like 5
Link to comment
Share on other sites

Thanks Guys,

 

and where would I look for it in the Documentation ?

Is it there at all ?

Link to comment
Share on other sites

I'm not sure if it's in the docs or not. I first read about it in a forum post, but a quick search of the docs doesn't yield any results for me. I'm sure Jack or Carl can let us know if it's in there or not. 

 

In the meantime, a similar question was asked and this post may help you:

http://greensock.com/forums/topic/9211-need-help-with-properties-in-gstransform-object/

 

Happy tweening.

:)

Link to comment
Share on other sites

Doh! That's right - now I remember that.  :rolleyes:  

 

I sometimes do a docs search and get 0 results even though I know it's in there. 

  • Like 2
Link to comment
Share on other sites

Thanks everyone, your really helping !

 

SmoothOrigin still only works for SVGs right ?

Will this be changed in the near future ?

Would be important for me !

 

cheers

Link to comment
Share on other sites

I'm having trouble with the dblclick recognition , could this be a gsab issue ?

Link to comment
Share on other sites

smoothOrigin is for SVG only, that's correct. There haven't been enough community requests to justify porting that to regular CSS transforms as well yet. We'll keep listening though. 

 

As for Double-click recognition, I can't imagine how GSAP could possibly interfere with that. Feel free to do a test and just remove GSAP from the equation and see if it works. If you think it's GSAP, please create a reduced test case in codepen and send it our way; we'd be happy to take a peek. 

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