Modify ↓
Ticket #10454 (closed bug: invalid)
offset().top returns wrong value for fixed elements and their children when page is scrolled
| Reported by: | m@… | Owned by: | |
|---|---|---|---|
| Priority: | low | Milestone: | None |
| Component: | offset | Version: | 1.6.4 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
Just what the summary says. Chrome v14.0.835.202. jQuery 1.6.4.
The value of offset().top for fixed elements and their children appear to have the value of $(window).scrollTop() added to what the correct value should be. This screws up positioning pop-up elements relative to the fixed element or child.
Change History
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
Note: See
TracTickets for help on using
tickets.

It seems to me that fixed positioning should not affect offset. Offset deals with the position of the element relative to the rest of the document, which is not the same as .css('top')