我有 2 个圆圈,单击大圆圈我正在使用类名找到小圆圈并尝试为小圆圈设置动画,但根本不起作用。
但是fadeId,fadeOut 属性正在工作。
我的功能:
var paper = new Raphael('myPaper',500,500);
var circle = paper.circle(100,100,100).attr({'fill':'red'});
circle.node.setAttribute('class','red');
var text = paper.text(100,100,"test Text").attr({'fill':'#fff'});
var smallCircle = paper.circle(300,100,50).attr({'fill':'green'}).data('id','green');
smallCircle.node.setAttribute('class','green');
var newSet = paper.set();
newSet.push(circle,text);
newSet.attr({cursor:'pointer'}).data('id','oval');
$('.red').on('click',function () {
$('.green').animate({'cx':200},5000); //animation not working.
} )
</p>