When the mouse is moved over an element, I want to get the mouse coordinates of the cursor relative to the top-left of the element\'s content area (this is the area excludin
In your element_position(e) function, iterate through the hierarchy using parentNode, get the padding, offsets and border using getComputedStyle(e, null).getPropertyValue(each_css), and sum them to the value of your x and y values before return.
There's a post proposing a cross-browser reading of styles here:
http://bytes.com/topic/javascript/answers/796275-get-div-padding