Jump to content
Search Community

No translate3d ?

RenanSantos
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

Can't i use translate3d in my tweens?

I see x and y for translate, but no translate3d!

Posted

Sure, just use z. 

 

TweenLite.to(element, 1, {x:100, y:20, z:300});
 
Posted

But x and y will be a 2d translate and not the same as translateX and translateY.

Posted

What do you think is different exactly?

Posted
Isn't that right that translate3d triggers hardware acceleration?

So it would be better to use it when it's available...
Posted

Using z: 0.1 generates a matrix3d, so, i think it's ok!

Posted

Yep, and for the record, translate3d() is no different (as far as I know) than adding a translateZ() in terms of triggering hardware acceleration. The whole idea is to just have a non-zero z. It's just that translate3d() is a shorter way than typing out translateX() translateY() translateZ() 

  • Like 1
  • 1 year later...
Posted

Ok.

I am using: "{x: 0, y: 0, z: .001}" to replace "translate3d(0, 0, 0)"... is there a way I can trigger this without using a low z value?

jamiejefferson
Posted

Yes in GSAP there is a force3D property you can add to a tween that tells the object to apply this tweak. It only needs to be added to an object once and GSAP will remember it for future tweens.

TweenLite.to(foo, 1, { x:100, force3D:true });
  • Like 4

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