Raphael JS : how to move/animate a path object?
问题 Somehow this doesn't work... var paper = Raphael("test", 500, 500); var testpath = paper.path('M100 100L190 190'); var a = paper.rect(0,0,10,10); a.attr('fill', 'silver'); a.mousedown( function() { testpath.animate({x: 400}, 1000); }); I can move rects this way but not paths, why is that, and how do I move a path object then?! 回答1: With the latest version of Raphael, you can do this: var _transformedPath = Raphael.transformPath('M100 100L190 190', 'T400,0'); testpath.animate({path: