Unykvis Unykvis - 1 year ago 93
jQuery Question

How to animate CSS Translate

Is it possible to animate the CSS property translate via jquery?

$('.myButtons').animate({"transform":"translate(50px,100px)"})


and does it work in many browsers?

Demo not working: http://jsfiddle.net/ignaciocorreia/xWCVf/

UPDATE:

My solutions:


  1. Simple implementations - http://jsfiddle.net/ignaciocorreia/R3EaJ/

  2. Complex implementation and multi-browser - http://ricostacruz.com/jquery.transit/


Answer Source
$('div').css({"-webkit-transform":"translate(100px,100px)"});​

http://jsfiddle.net/xWCVf/5/