Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
BigSmalls

margin auto

Recommended Posts

Help plz.

Inner block jumps to a horizontal alignment without animating itself there.
Initially I was running both animations simultaneously and so I thought that perhaps the inner block may not know the horizontal dimensions to calculate margin auto if the outer block is animating its 'left' attribute, but it turns out that the animation doesn't work even after the outer block finished animating.

Thanks for the help!

See the Pen vgoiL by samaraiza (@samaraiza) on CodePen

Link to post
Share on other sites

Because "auto" isn't a number, so GSAP doesn't have values to interpolate between. In other words, what's halfway between 10px and "auto"? :) You could try calculating the number you're looking for using things like offsetLeft and offsetTop.

Link to post
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.

×