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.
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…