Jump to content
Search Community

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

Was wondering if there is a "clip" plugin similar to jQuery "clip" effect that can be used on alpha animation.

http://api.jqueryui.com/clip-effect/

 

Need it for horizontal clip. Thought about using scaleX, however, how do you shift center point so clipping starts not from the center but from the left.

 

Thanks!

Posted

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
Posted

Got it to work. Thank you everyone for your help! :-D

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