Jump to content
Search Community

X position and transform-origin relation

ninmorfeo test
Moderator Tag

Go to solution Solved by PointC,

Recommended Posts

I wanted to ask, does gsap take into account the transform-origin property when I place an object with the property X ?
I'm trying to position the box you see in the image with gsap.set, setting the X property to 0, but I see that by changing the transfer-origin parameter in the css I don't get the results I expect as I show in the image, but it always remains as if the transfer-origin property were set to 0,0

transform-orig.jpg.689b48740a2082a985c5a6de7c811bd6.jpg

Link to comment
Share on other sites

  • Solution

Transform (scale, rotation) default points are in the center of HTML elements. Translation (x/y) is top left.

 

If you want it to be in the center, try this.

gsap.set(".box", { xPercent: -50, yPercent: -50 });

 

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