Bug Tracker

Modify

Ticket #6151 (closed bug)

Opened 3 years ago

Last modified 14 months ago

offset() gives wrong values in iframe if parent scrolled

Reported by: friedcell Owned by: friedcell
Priority: low Milestone: 1.5
Component: offset Version: 1.4.1
Keywords: iframe offset Cc: brandon
Blocking: Blocked by:

Description

When trying to get the offset of an element that is inside an iframe, offset() will return wrong values if the outer document is scrolled (scrollTop != 0).

Case with instructions is on  http://code.zemanta.com/fry/outer.html

Bug traced back to use of self for window reference instead of elem.defaultView. Patch available on github:  http://github.com/friedcell/jquery/commit/1c8ca5b257644653667676fe97b210e587fb7d19

Change History

comment:1 Changed 3 years ago by friedcell

I'm guessing this was fixed in 1.4.2?

comment:2 Changed 3 years ago by SlexAxton

  • Keywords iframe offset added
  • Owner set to friedcell
  • Priority set to low
  • Status changed from new to pending
  • Milestone changed from 1.4.2 to 1.5

Does that mean that you tested it in 1.4.2 and it worked? Can you let us know if this is still an issue for you? Thanks.

comment:3 Changed 3 years ago by anonymous

According to the comment on github it was fixed, but looking at the case now it seems utterly broken.

comment:4 Changed 3 years ago by trac-o-bot

  • Status changed from pending to closed

Automatically closed due to 14 days of inactivity.

comment:5 Changed 19 months ago by anonymous

This is fixed in jQuery 1.5 and 1.6 in firefox, but not in IE8 and below.

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.