Get offset of an element within the document