Bug Tracker

Modify

Ticket #4993 (closed bug: worksforme)

Opened 4 years ago

Last modified 3 months ago

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:
Blocking: Blocked by:

Description

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

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

Change History

Changed 4 years ago by gkertesz

comment:1 Changed 4 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 4 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 3 years ago by snover

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

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

comment:4 Changed 14 months ago by danboy19@…

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

 http://stackoverflow.com/questions/3638688/jqueryui-autocomplete-suggestions-misplaced-in-chrome

comment:5 Changed 8 months 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 7 months 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:

 $(selector).css('left')

does return the correct value.

comment:7 Changed 7 months ago by anonymous

Here is the Fiddle for the example above

 http://jsfiddle.net/sFYjc/2/

comment:8 Changed 7 months 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 5 months ago by anonymous

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

Same as comment 6 & 7

 http://jsfiddle.net/sFYjc/2/

comment:10 Changed 5 months ago by anonymous

comment:11 Changed 5 months ago by mikesherov

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

comment:12 Changed 3 months ago by mikesherov

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.