tags:

views:

334

answers:

3

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

A: 

See http://docs.jquery.com/CSS/offset.

ceejayoz
+5  A: 

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.

Paolo Bergantino
A: 

Thanks for the reference Paolo!

arturocr