How to animate CSS Translate

Ignacio Correia picture Ignacio Correia · Dec 23, 2012 · Viewed 154k times · Source

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

flec picture flec · Dec 23, 2012

There are jQuery-plugins that help you achieve this like: http://ricostacruz.com/jquery.transit/