Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
mouret

Use .set and keep existing css?

Recommended Posts

If i have set transform either with css og TweenMax.set - e.g. transform: translateZ(100px); can I add other transform translates/rotations/etc. and keeping the translateZ?

Link to post
Share on other sites

You can do independent transforms with GSAP, but not by setting the transform property directly. Use x, y, z, scale, rotation, ect. Look at the CSSPlugin docs for more info about transforms.

https://greensock.com/docs/#/HTML5/GSAP/Plugins/CSSPlugin/

 

Also note that for certain 3D rotations, you may need to nest your element inside another element that is rotated in the opposite direction to remove the effect from a transform.

See the Pen woXQNz by osublake (@osublake) on CodePen

 

.

  • Like 2
Link to post
Share on other sites

Thank you OSUblake, I resolved to individual x,y,z properties in stead of a combined transform.

Link to post
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.

×