Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using jquery, can I get the X and Y offsets of a particular element?

Tags:

jquery

Using jquery, can I get the X and Y offsets of a particular element?


1 Answers

Relative to what? Its parent? The document?

CSS/position gets the top and left position of an element relative to its offset parent.

CSS/offset gets the current offset of the first matched element, in pixels, relative to the document.

like image 79
Paolo Bergantino Avatar answered Nov 22 '25 15:11

Paolo Bergantino