Reputation: 69
I'm new to Raphael and trying to move a circle I created, either by animation or just by setting the new X and Y coordinates.
_raphael = Raphael(10, 10, 800, 600);
var nodeCircle = _raphael.circle(100,100,30);
nodeCircle.animate({x:500, y:200}, 1000);
I can't figure out why this isn't working. I'm rendering in IE9 but also doesn't work in Firefox. Thanks for any help!
Upvotes: 0
Views: 289
Reputation: 13852
Thats because a circle uses cx and cy and not x,y..so this should work...
_raphael = Raphael(10, 10, 800, 600);
var nodeCircle = _raphael.circle(100,100,30);
nodeCircle.animate({cx:500, cy:200}, 1000);
Upvotes: 1