How to animate a Raphael object along a path?

javascript, jquery, raphael

Solution

Just in case you are trying to use this with RaphaelJS 2 (animateAlong doesn't exist anymore), here you can see a possible solution: http://jsfiddle.net/gyeSf/17/.

And here the original discussion: https://groups.google.com/forum/#!searchin/raphaeljs/animatealong/raphaeljs/W9bA0SkArVY/KnPRKi8uFrsJ

Edit: And here another example: http://raphaeljs.com/gear.html

Problem

The object could be simple, a rect or circle. But the path should be a bezier curve. Please provide javascript/Raphael code if not too much trouble. It will be nice if there is trailing effect of the moving object during annimation.

Original source