Jump to content
Search Community

jQuery Animation Effects

User7 test
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

Hi and welcome to the GreenSock forums.

 

In order to change the transformation origin you can set the transformOrigin property in the instance's config object, like this:

TweenLite.to(element, time, {scaleX:0, transformOrigin:"0% 50%"});

transformOrigin modifies the element's transform-origin property (pretty obvious huh ;)), basically changing it's fix point for the transform property. By default is the center of the element (50% 50%). The first value corresponds to the X axis and the second value is the point in Y axis. Also you can supply a third value, that states the transform point in the Z axis, but in order to emulate jQuery's UI effect you don't need it.

 

I set up a simple codepen so you can see it:

 

See the Pen aHJei by rhernando (@rhernando) on CodePen

 

Feel free to fork and adapt it to your scenario.

 

Rodrigo.

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