return the offset relative to the document of a matched element specified by compass points