i'm using the excellent raphaeljs library and after having created a path with
var c = paper.path("M10 10L90 90 ..... z");
i would like to get the position of the click event on the path relative to the canvas. I tried:
c.click(function (event) {
alert(event.pageX);
}));
but that gives me a value which is not relativ开发者_如何学Pythone to raphael's canvas. Any idea? thx
Something like
var x = Math.floor((event.pageX-$("#paper").offset().left));
Obviously this is using jQuerys $ to get the paper element..
精彩评论