As a rule, you do not want to mix jQuery and Raphael, as this is easily confused with what library handlers and methods you use. You also lose the Raphael backup options for older browsers when you start directly messing with the DOM elements that Raphael creates.
In this case, I recommend adding the .mousedown() listener directly to the Raphael element.
var paper = new Raphael($(".testarea")[0], $(".testarea").width(), $(".testarea").height()); var circAttr = { "fill": "#4ba6e8", "stroke": "#1a81cc", "stroke-width": "2" }; paper.circle(200, 200, 80).attr(circAttr).mousedown(function() { someFunction(this); }); var someFunction = function(shape) { console.log(shape.getBBox()); };
Updated script: http://jsfiddle.net/auyaC/3/
Of course, you lose the ability to immediately select all the shapes using the selector and add an event to all of them at once. You will need to add a mousedown event to each one created. A little compromise, I think.
source share