how to get the position of a node in the document?

how to get the position of a node in the document?

use $(selector).position()
we can get the coordinates of the node relate to its offset parent
but how could i get the coordinates relate to the document element?