javascript - How to get relative cursor position to clicked element when appears click event in JQuery? -
I want to read the position relative to the clicked element Have you tried:? e.target instead of the
eventObject I am PageX and
eventObject.pageY .
var eventObject = null; $ (Document). Click (function (e) {eventObject = e; // How to get position regarding e.target ??});
var posx = $ (this). composition (). Left, pause = $ (this). composition (). Top; Warning ((e.pageX - posX) + ',' + (E.P.G.I. - Possi));
Comments
Post a Comment