Bug Tracker

Modify

Ticket #10454 (closed bug: invalid)

Opened 20 months ago

Last modified 6 months ago

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

comment:1 Changed 20 months ago by timmywil

  • Priority changed from undecided to low
  • Resolution set to invalid
  • Status changed from new to closed
  • Component changed from unfiled to offset

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')

comment:2 Changed 6 months ago by chanibal

Confirmed in webkit in some androids < 4.0.4 (all from Samsung's touchwiz custom ROM)

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.