Skip to main content

Bug Tracker

Side navigation

#12706 closed bug (notabug)

Opened October 11, 2012 05:14PM UTC

Closed October 11, 2012 11:03PM UTC

Last modified October 11, 2012 11:15PM UTC

.offset() is off by 8px in IE9 in some cases

Reported by: scottgonzalez Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.8.2
Keywords: Cc:
Blocked by: Blocking:
Description

I'm not sure exactly what is required for this, but it seems that at a minimum there needs to be html { height: 100%; } and body { height: 100% margin: 0; } as well an absolutely positioned element.

The first time .offset() is called, the left value is off by 8 pixels. Subsequent calls are correct.

http://jsfiddle.net/bAE53/

Original jQuery UI ticket: http://bugs.jqueryui.com/ticket/8656

Attachments (0)
Change History (4)

Changed October 11, 2012 10:47PM UTC by dmethvin comment:1

owner: → scott.gonzalez
status: newpending

So should the two numbers be the same? They aren't in Chrome (146.5 vs 155 = 8.5), Firefox (92.58332824707031 vs 99.66667175292969 = 7.08), Safari5 (198 vs 206 = 8) and yes IE9 (101 vs 110 = 9).

Changed October 11, 2012 10:49PM UTC by scottgonzalez comment:2

owner: scott.gonzalez
status: pendingnew

They should be the same, since the text field doesn't move. Interestingly I get consistent results in Chrome.

Changed October 11, 2012 11:03PM UTC by scottgonzalez comment:3

resolution: → notabug
status: newclosed

Nevermind...

Changed October 11, 2012 11:15PM UTC by scottgonzalez comment:4

In case anyone comes across this in the future...The test case was supposed to have the ul absolutely positioned so that it wasn't affecting the flow. I forgot to add that in the fiddle, but adding that doesn't change the behavior anyway. It turns out to be related to top: auto (default) on absolutely positioned elements. Explicitly setting the top made this behave as expected. This may still be a bug, but it just seems like incorrect browser behavior and an edge case with all the CSS that was required to cause this happen. Lastly, the behavior was as expected for me in Chrome 21 and Canary on OS X, but "broken" in every other browser, including Chrome on Windows