visionmedia / move.js

CSS3 backed JavaScript animation framework
http://visionmedia.github.com/move.js/
4.72k stars 686 forks source link

Add support for percentage values #40

Closed alkavan closed 8 years ago

alkavan commented 10 years ago

I have made a commit here: https://github.com/alkavan/move.js/commit/cd9a80a02c38c567fe7a36ab7710c0730db29fb2

This is an example of modified translateX() and translateY() methods to support passing percent values, for example translateX('60%') or translateX('-60%') would work now.

I think this is something that should be done to all types that support percent values, I can do this because I really need this functionality, but I wonder if you'll pull this changes if I'll add this to all methods, because while I don't really need this for all of methods, someone else might ...

UPDATE: also added to translate() method: https://github.com/alkavan/move.js/commit/d108addf231eaec15dcc075823246f2b20ffbc4d

hkan commented 10 years ago

I use translateY(-50%) in my CSSs for vertical alignment. When I apply Move(selector).x(100) on that particular elements, the translateY gets overriden so I have to do Move(selector).x(100).y("-50%") but that breaks all the Move.js library. Support has to be added into it.

yields commented 10 years ago

SGTM! pull requests are welcome!