Jump to content
GreenSock

momo12

Is it possible to resize elements from one Edge?

Go to solution Solved by GreenSock,

Recommended Posts

Guys. I have a question. Is it possible to tell GSAP to resize elements from one edge? I know GSAP is not After Effects but was wondering :))

Like change the Scale Y of an element from the top edge and vice versa. Normally with CSS, you must play with the top and bottom values to do such a thing. 

Link to comment
Share on other sites

Are you talking about transformOrigin maybe? Like...when it scales down to zero, for example, you want it to act like its top left (or bottom right or whatever) is "pinned"? If so, yeah, like transformOrigin: "top left" would make it scale as if the top left corner of the element itself is "pinned". 

Link to comment
Share on other sites

30 minutes ago, GreenSock said:

Are you talking about transformOrigin maybe? Like...when it scales down to zero, for example, you want it to act like its top left (or bottom right or whatever) is "pinned"? If so, yeah, like transformOrigin: "top left" would make it scale as if the top left corner of the element itself is "pinned". 

Like the below picture. Is there an easier way to resize elements from one edge? The left rectangle will get scaled down from top edge and the right, from the bottom edge.

Untitled (8).png

Link to comment
Share on other sites

1 minute ago, GreenSock said:

That's exactly what I just described. transformOrigin

 

 

 

Thanks a lot man!

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