Anime: String paramaters to CSS properties

Created on 31 May 2017  路  4Comments  路  Source: juliangarnier/anime

Hi!

How could I set the "left" CSS property to "auto" within anime js?

Thanks!

Most helpful comment

@dpw1 has a good point. Animating to an "auto" value could be very handy in Anime. Consider a use case like jQuery's slideDown() animation, where an element's height is animated from 0 to "auto" without having to show the element and manually calculate it's final height before hiding again and animating - very cumbersome!

All 4 comments

Hey,

You can't, _anime_ needs at least one digit in the value parameters in order to work.
Try calculating the value in JS instead of using auto.

Hmm could I possibly add a class to the element on a 'complete' callback?

Yes you can add a class on a complete callback, but I'm not sure to understand how this will help you animating to auto

@dpw1 has a good point. Animating to an "auto" value could be very handy in Anime. Consider a use case like jQuery's slideDown() animation, where an element's height is animated from 0 to "auto" without having to show the element and manually calculate it's final height before hiding again and animating - very cumbersome!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

DavudSafarli picture DavudSafarli  路  5Comments

bravebox picture bravebox  路  3Comments

Crashtor picture Crashtor  路  5Comments

ndimatteo picture ndimatteo  路  5Comments

lukebatchelor picture lukebatchelor  路  7Comments