简体   繁体   English

动画拉斐尔圆

[英]Animating a Raphael circle

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的新手,尝试通过动画或仅通过设置新的X和Y坐标来移动创建的圆。

_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. 我正在IE9中渲染,但在Firefox中也无法正常工作。 Thanks for any help! 谢谢你的帮助!

Thats because a circle uses cx and cy and not x,y..so this should work... 那是因为圆使用cx和cy而不是x,y ..所以这应该工作...

_raphael = Raphael(10, 10, 800, 600);    
var nodeCircle = _raphael.circle(100,100,30);

nodeCircle.animate({cx:500, cy:200}, 1000);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM