Jump to content
GreenSock

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

transformOrigin not working?

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

Hello,

 

I'm having some trouble with a transformation.

Take a look at the example:

 

http://cdpn.io/eoGnI

 

When you click on some text to expand, the red square should remail aligned to the left.

The transformation should take the bottom left corner as it's origin point, and grow to the right. Instead it grows from the center.

 

Is there someting I'm doing wrong?

 

I would appreciate any advice on the matter.

 

Thanks in advance

Link to comment
Share on other sites

Hi,

 

It is a bit difficult to understand all the code as the methods, properties, vars etc aren't in English.

 

From what I gather though, the reason transformOrigin isn't working as expected is because it does not work with width and height, only css transforms: scale, scaleX, scaleY, rotate etc.

 

bad:

TweenLite.to(listaElems[cual],.3,{ height: txtAltos[cual], transformOrigin:"left bottom", ease:Cubic.easeOut});

good:

TweenLite.to(listaElems[cual],.3,{ scale:1.5, transformOrigin:"left bottom", ease:Cubic.easeOut});
Link to comment
Share on other sites

ok, thank you.

I'll try to covert height pixels into scale and let you know how it goes.

 

Regards

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