Velocity.js. Reset {bottom, top} to "auto" doesn't work and it remains "0px"

646 Views Asked by At

I'm using Velocity in this way.

I need Velocity reset the top:"0px" to "auto", but id doesn't work.

It's a bug? Or it's me?

It is the right way to do this animation or not?

1

There are 1 best solutions below

6
On BEST ANSWER

Animating to auto is simply not supported in Velocity. There are many ways to tackle this, a simple one would be to store the initial top position and then reuse it like here: http://jsbin.com/wudepalude/2/