I am trying to get the absolute position (top and left) of the mouse click relative to the browser / body, and not any parent elements in the body.
I have a body listener, but e.pageX and e.pageY give me position relative to the div.
Please note that I can use jQuery and YUI functions.
Code that currently does not work correctly:
function _handleClick(e) {
var data = { absX: e.pageX, absY: e.pageY};
_logClickData(data);
}
var methods = {
init: function () {
$("body").click(_handleClick);
}
};
source
share