bendc / animateplus

A+ animation module for the modern web
MIT License
5.96k stars 280 forks source link

Animating percentages from/to px #26

Closed iamvdo closed 6 years ago

iamvdo commented 7 years ago

Seems to be a bug at first:

animate({
  el: 'div',
  translateX: ['100%', 0]
})

or

animate({
  el: 'div',
  translateX: '100%',
  direction: 'reverse'
})

I expect an animation from 100% to 0, but got from 100px to 0. See: http://jsbin.com/fitezotivo/edit?js,output

It seems to occur when animating percentages from/to px (as no unit is converted to px). Using translateX: ['100%', '0%'] fix the first case, but we're still facing the issue when using direction: reverse

bendc commented 6 years ago

Fixed in v2.0.0