是否可以为raphael元素定义自定义属性?
例如
r.circle(25,50,10).attr({fill:'#b71e16', stroke:'#71140f', 'my_custom_attribute':'a value'});
Run Code Online (Sandbox Code Playgroud)
我需要这个的原因是我想在一整套元素上做一些相当复杂的动画,我想在某处存储每个元素的原始y坐标.
我怎么能用raphael js改变路径位置?
非常奇怪,明显的方式不起作用:
var p = paper.path("some path string");
p.attr("fill","red");
p.attr({x:200,y:100}); //not working
Run Code Online (Sandbox Code Playgroud)