I have been working with Raphael to create drag and drop shapes on a canvas. I do this using the .drag()
function (supplied in the Raphael framework) along with my
As the accepted answer didn't work for me (though it did get me on the right track) I thought I would post how I solved it in case there is anybody else in my position...
//Create paper element from canvas DIV
var canvas = $("#Canvas");
paper = Raphael("Canvas", canvas.width(), canvas.height());
//Register Event
$("#Canvas").click(CanvasClick);
//Event Handler
function CanvasClick(e) {
if (e.target.nodeName == "svg")
{
//This will only occur if the actual canvas area is clicked, not any other drawn elements
}
}