Bug Tracker

Opened 14 years ago

Closed 12 years ago

Last modified 10 years ago

#4993 closed bug (worksforme)

offset() and position() return wrong values in Chrome when page is zoomed

Reported by: gkertesz Owned by: brandon
Priority: major Milestone:
Component: offset Version: 1.3.2
Keywords: chrome zoom Cc:
Blocked by: Blocking:


offset() and position() return true pixel values in Google Chrome at all page zoom levels.

In contrast, in FF, IE and Opera they return values compensated for the actual page zoom.

Attachments (1)

zoom.html (732 bytes) - added by gkertesz 14 years ago.

Download all attachments as: .zip

Change History (14)

Changed 14 years ago by gkertesz

Attachment: zoom.html added

comment:1 Changed 13 years ago by jaffathecake

This is because getBoundingClientRect is buggy in webkit (same issue exists in Safari 4). I'm guessing it's returning the rect after the zoom has been applied.

To fix the issue, avoid getBoundingClientRect in webkit.

Cheers, Jake.

comment:2 Changed 13 years ago by jaffathecake

Looks like they've fixed the issue in webkit https://bugs.webkit.org/show_bug.cgi?id=25750

comment:3 Changed 12 years ago by snover

Resolution: worksforme
Status: newclosed

This should be fixed in all currently support versions of Chrome (7+). Please reopen if this is not the case.

comment:4 Changed 11 years ago by [email protected]

In 2012, this seems to be broken again. I'm using jquery ui autocomplete in Chrome 17:


comment:5 Changed 10 years ago by anonymous

I am experiencing this issue as well, I've upgraded to latest versions of jquery but it hasn't made a difference

comment:6 Changed 10 years ago by anonymous

I am experiencing this issue too using:

 $(selector).animate({left: '-=' + value}, 200)

does not return the correct 'left' value when zoomed but the code:


does return the correct value.

comment:7 Changed 10 years ago by anonymous

Here is the Fiddle for the example above


comment:8 Changed 10 years ago by anonymous

Comment 7 pretty much sums up the problems that I've been having with even the latest versions of jQuery. The behavior is slightly different but just as problematic when zoomed out. I've noticed that browsers using the Webkit engine are affected, and IE and Firefox have no such issues.

comment:9 Changed 10 years ago by anonymous

I am experiencing this problem too - with Chrome version 23.

Same as comment 6 & 7


comment:10 Changed 10 years ago by anonymous

comment:11 Changed 10 years ago by mikesherov

Adam, thanks for filing the WebKit bug. You have a typo in the title: getComputerdStyle.

comment:13 Changed 10 years ago by [email protected]

Here's one for .css('left') I happened to stumble accross.. well, guess I'm waiting for it to be fixed. http://jsfiddle.net/RaznH/1/

Note: See TracTickets for help on using tickets.