Jump to content
Search Community

Use .set and keep existing css?

mouret
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

Posted

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?

Posted

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
Posted

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

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