I have a Raphael.js icon that I am trying to attach a click even listener to. When I fire the function automatically ( using closure brackets () ) the console log is successful. However, I cannot fire the event with no automatic execution of the function. Is there an known bug/issue with transforms that puts the rendered path elsewhere on the page? I've poured through comments here, if anyone has seen a similar issue please post.
var paper3 = Raphael($("#mail").get(0), 175, 75);
var iconPath3 = paper3.path(iconPath);
iconPath3.transform("s1.3, t0,5");
iconPath3.attr("fill","fff");
iconPath3.click(function(e) {
console.log("Test");
});
You could try wrapping iconPath3 in a jQuery object:
$(iconPath3).click(function(e){
console.log("Logging event: ", e);
});
Also, have you tried setting fill using a JavaScript object:
iconPath3.attr({fill: '#fff'});
Hope that helps.