Jump to content


xpercent and ypercent

Moderator Tag

Recommended Posts

I like to center with top: 50 % left 50% translate (-50%, -50%) but recognize this uses a transform (see codepen). In addition to xpercent and ypercent (thanks for this addition greensock), do I use .set to give it this state that .to and .from can be chained?

See the Pen XmKVGx by jstafford (@jstafford) on CodePen

Link to comment
Share on other sites

Hi jstafford :)


if i understood your question correctly , yep you just need to set once .  xPercent:-50 , yPercent:-50

  • Like 2
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.