Skip to content

Instantly share code, notes, and snippets.

@stesla
Created September 3, 2011 03:49
Show Gist options
  • Save stesla/1190521 to your computer and use it in GitHub Desktop.
Save stesla/1190521 to your computer and use it in GitHub Desktop.
var paper = Raphael("animation", 785, 200);
var left, right, circle = paper.circle(30, 100, 20).attr("fill", "black");
right = function() {
circle.animate({cx: 700, r: 80, fill: "red"}, 3000, "bounce");
circle.node.onclick = left;
};
left = function() {
circle.animate({cx: 30, r: 10, fill: "black"}, 3000, "bounce");
circle.node.onclick = right;
}
circle.node.onclick = right;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment