jquery gets the absolute position coordinates of the HTML element and the position coordinate method of the relative parent element:
Absolute position Coordinates:
$ ("#elem"). Offset (). Top
$ ("#elem"). Offset (). Left
Position coordinates relative to parent element:
$ ("#elem"). Position (). Top
$ ("#elem"). Position (). Left
Other:
Static (default): The default positioning method.
Relative (relative positioning): On the basis of static, relative elements of the original position change, by setting the Top,bottom,left,right implementation.
Absolute (absolute positioning): is relative to the parent element, if there is relative in the parent element, then the position of the element is the computed result. That is, the reference to absolute positioning is "the last positioned parent element (static not counted)". Absolute positioning causes the element to be deleted from the document stream.
Fixed position: the reference to the fixed position is always the current document. With fixed positioning, it's easy to have a div positioned on top left and right in the browser document.
jquery gets the absolute position and relative position of the HTML element