When you do something like this:
var originalOffset = something.offset()
something.offset({top:0,left:0})
something.offset(originalOffset)
I would expect something to be in exactly the same position in the page afterwards.
Well, this is not the case in my context. What properties of offset() destroy this desired behavior?
This works if the offset parent of the element is the document, but not always if the element is inside another element that is positioned.
The
offsetmethod returns the position relative to the document, you should try thepositionmethod instead, which returns the position relative to the offset parent.