Home >Web Front-end >JS Tutorial >jquery method to get the absolute position and relative position of html elements_jquery
Absolute position coordinates:
Position coordinates relative to the parent element:
Also:
static (default): default positioning method.
Relative (relative positioning): Based on static, the original position change of the relative element is achieved by setting top, bottom, left, and right.
Absolute (absolute positioning): It is relative to the parent element. If there is relative in the parent element, then the position of the element is the calculated result. That is, the reference object for absolute positioning is "the last positioned parent element (static does not count)". Absolute positioning causes the element to be removed from the document flow.
fixed (fixed positioning): The reference object of fixed positioning is always the current document. Using fixed positioning, it is easy to position a div in the upper left, upper right, etc. of the browser document.