Chapter 5: Basic Animation

by Stéphane Cabaret

JavaScript

var paper = Raphael(0, 0, 500, 500);

var dot = paper.circle(50, 50, 20).attr({ "fill": "red" });

var anim = Raphael.animation({cx: 100, cy: 200, fill: "blue" }, 1000 ,"bounce").delay(3000);

dot.animate(anim.repeat(5));