2

Sometimes, when I ask for the .position().top value of some object, it does not return the absolute value, i.e. if some picture is added before, the .position().top value does not change. How may I ask for the absolute position of an object (in this case a div)?

Jjm
  • 261
  • 2
  • 10

1 Answers1

2

From the jquery docs:

The .position() method allows us to retrieve the current position of an element relative to the offset parent. Contrast this with .offset(), which retrieves the current position relative to the document.

http://api.jquery.com/position/

So use .offset().

Mario A
  • 3,286
  • 1
  • 17
  • 22