michaelvillar / dynamics.js

Javascript library to create physics-based animations
http://dynamicsjs.com
7.57k stars 414 forks source link

Why % css doesn't work #34

Open antoninlanglade opened 8 years ago

antoninlanglade commented 8 years ago

I try to use css percent value and the result is bad. The animate func try to animate to the value, if you put 50% on a width for example, it will translate to 50px and in the end of animation set 50%. Strange result

michaelvillar commented 7 years ago

Yeah, the way that dynamics works, it's difficult (to not say impossible) to make it work for percentage units. Because dynamics only ask for the end value, dynamics needs to retrieve the current value from the DOM, and that current value is in absolute units (pixels), not relative (percentage).

antoninlanglade commented 7 years ago

Thanks for your reply. So bad ... In GSAP TweenMax we can. It's an important feature because when you are handling with DOM values like width, translate ... % it's very useful. You have some cool stuff that GSAP don't have so in the future I will use the two libraries.