我对raphael.js很新,我正在尝试为raphael元素制作动画。例如,我使用paper.path()绘制了一个箭头。
var arrow = paper.path("M10,10L100,100");
arrow.attr({
"stroke-width": 5,
"stroke-dasharray": "-.",
"arrow-end": "classic-wide-long"
});
如何使箭头的颜色在绘制时看起来像闪烁一样?
答案 0 :(得分:1)
使用.animate()
。
如,
arrow.animate({
"25%": {stroke: "pink", easing: "bounce"},
"50%": {stroke: "red", easing: "bounce"},
"75%": {stroke: "pink", easing: "bounce"},
"100%": {stroke: "red", easing: "bounce"}
},2500);
其中百分比是达到指定持续时间的帧步骤(在这种情况下为2500毫秒)。