Bug Tracker

Modify

Ticket #3322 (closed bug: wontfix)

Opened 5 years ago

Last modified 5 years ago

offset body does not work in Safari / Chrome

Reported by: ajpotts Owned by: brandon
Priority: major Milestone: 1.3
Component: offset Version: 1.2.6
Keywords: Cc: ajpotts, flesler
Blocking: Blocked by:

Description

If the BODY is offset from the HTML then offset should report that number - but it's zero in webkit.

Test case here:

 http://www.partyark.co.uk/html/jqueryoffsetbody.html

Change History

comment:1 Changed 5 years ago by flesler

  • Cc ajpotts, flesler added
  • Owner set to brandon
  • Component changed from core to offset

comment:2 Changed 5 years ago by ajpotts

Addition: though this might seem an esoteric case, in fact if you make body { position: relative } then offset is going to be wrong for _all the time_ in Safari/Chrome, because it will miss the last step.

Styling the body with margin for centering or whatever is not uncommon: it means avoiding wrapping everything in an extra div tag. And if you do that, then you're likely to do a position:relative because you're most likely to want everything relative to the body than the html.

comment:3 Changed 5 years ago by ajpotts

Firefox2 also does not get this right for exactly the same reasons.

comment:4 Changed 5 years ago by brandon

  • Status changed from new to closed
  • Resolution set to wontfix

Adding position relative to the body element opens up a huge mess when dealing with offset. Margin is okay in the latest SVN but position relative and borders just wreak havoc.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.