What’s the easiest way to determine an elements position relative to the document/body/browser window?
Right now I’m using .offsetLeft/offsetTop, but this method only gives you the position relative to the parent element, so you need to determine how many parents to the body element, to know the position relaltive to the body/browser window/document position.
This method is also to cumbersome.
You can traverse the
offsetParentup to the top level of the DOM.