I was trying to rotate the object by a variable number of degrees to represent a dial. As the first step I tried doing the following:
window.onload = function() {
var paper = new Raphael(document.getElementById('canvas_container'), 500, 500);
var circle = paper.circle(100, 100, 80);
var arrow = paper.path("M 100 100 l -56.5 56.5 z");
arrow.attr({stroke: '#0a0', 'stroke-width': 3});
for(var i=0;i<=100; i+=1){
rotate_cw(arrow);
}
}
function rotate_cw (element){
element.animate({transform:"r-1,100,100"}, 10);
}
The animate works by itself but I am unable to make it work with an external function. Any solutions or workarounds?