SkidX / tweene

JavaScript Animation Proxy
http://tweene.com
Artistic License 2.0
353 stars 29 forks source link

unclear css transform properties #17

Open ingobecker opened 9 years ago

ingobecker commented 9 years ago

The following code doesn't work as expected:

Tweene.defaultDriver = 'velocity'
Tweene.to($('#circle'), {transform: 'translateX(12em)'}, 500)

Using

Tweene.to($('#circle'), {x: '12em)'}, 500)

does the job. The documentation states

Tweene takes care of this thing for you, accepting a wide range of different names and replacing them accordingly to those accepted by the library currently used.

To me, that sounds like 'if you are using something other than expected by the underlying library, i will fix this for you' . I'm unsure whether it's a bug or the documentation lacks a good explanation how to supply an appropriate property.

SkidX commented 9 years ago

It supports both {translateX: 12em} and {x: 12em} but it does not perform a full parsing of the transform compound property. That part of the documentation is about "single-value" properties. About supported compound properties, you can see here: http://tweene.com/docs/#compoundProperties Transform is not in the list :)