Drag, drop and shape rotation with Raphael JS
I'm using RaphaelJS 2.0 to create several shapes in a div. Each shape needs to be able to be dragged and dropped within the bounds of the div, independently. Upon double clicking a shape, that shape needs to rotate 90 degrees. It may then be dragged and dropped and rotated again. I've loaded some code onto fiddler: http://jsfiddle.net/QRZMS/ . It's basically this: window.onload = function () { var angle = 0; var R = Raphael("paper", "100%", "100%"), shape1 = R.rect(100, 100, 100, 50).attr({ fill: "red", stroke: "none" }), shape2 = R.rect(200, 200, 100, 50).attr({ fill: "green", stroke: "none"