Ticket #4202 (closed bug: wontfix)
Webkit: offset, body position relative
| Reported by: | braddunbar | Owned by: | brandon |
|---|---|---|---|
| Priority: | major | Milestone: | 1.4 |
| Component: | offset | Version: | 1.3.2 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
When the position of the body is relative, offset does not take into account the offset of the body from the html element.
In the attached file this is shown by attempting to calculate the left offset of a div within the body.
Firefox 3.0.6 and IE7 report correct values.
Safari 3.2.2 and Chrome 1.0.154.48 report incorrect values.
Attachments
Change History
Changed 4 years ago by braddunbar
-
attachment
offset.html
added
comment:1 Changed 4 years ago by brandon
- Status changed from new to closed
- Resolution set to wontfix
The last time I looked into this particular issue it had further reaching issues in all browsers and required a lot of code. The amount of code it required did not justify this particular edge-case to be fixed, especially when the workaround is so easy. Just use a container/wrapper div instead of the body tag.
With that said, I'll look into the issue again... make sure I didn't miss anything before. :)
comment:2 Changed 4 years ago by braddunbar
I agree that the fix is easy, but you don't always have control over the markup your plugin will be deployed with.
I actually found the issue when using a jquery UI plugin that inexplicably started getting the wrong offset.
I would like to look into this a bit more. Would you mind sending me a synopsis of your findings the first time around? Anything at all would be helpful.
Thanks!
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

Test Case showing incorrect offset calculation for relative position on body