Opened 9 years ago
Closed 9 years ago
#14742 closed bug (cantfix)
offset() and position() returns different value after touch gesture zoom in IE 10 and 11
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | undecided | Milestone: | None |
Component: | unfiled | Version: | 1.9.0 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
When using offset() and position() to get the left and top value, the value changes after zoom in IE 10 and 11. This issue always occurs in Metro IE 10 and 11, and only occurs in desktop IE 10 and 11 when zooming using touch gesture. Using keyboard zoom (Ctrl + "+"/"-") gives correct behaviour.
Tested on other browsers (i.e. Firefox, Safari, Chrome) and value did not change.
Tested with jQuery 1.9.0 and 1.11.0 and both reproduced the error.
Demo code below:
<!DOCTYPE html> <html> <head> <title>Demo</title> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> </head> <body> <div style="padding-left: 100px;"> <h3>Signature Pad demo</h3> <button id="testBtn" onclick="testOffset();">Test offset</button> <p id="testOutput"></p> <script> function testOffset() { var offset = $("#testBtn").position(); var str = "left=" + offset.left + "<br />" + "top=" + offset.top; $("#testOutput").html(str); } </script> </div> </body> </html>
Try it with Metro IE 10 or 11. Click on the button before zooming to get the original value, and then zoom and move the page. Clicking the button will change the value every time the page is zoomed/moved. This behaviour will also happen when using tough gesture zoom on desktop version IE 10 and 11.
Change History (4)
comment:1 follow-up: 2 Changed 9 years ago by
comment:2 Changed 9 years ago by
Replying to dmethvin:
Unfortunately I don't think any browser gives good position/offset results when the page is zoomed, and doesn't expose any scaling factor to let us determine the right values. This has existed forever and I've got a PR to address it that should land soon. https://github.com/jquery/api.jquery.com/issues/76
Thanks for the info. Is there any workaround to accommodate for this behavior in IE 10/11 at the moment?
comment:3 Changed 9 years ago by
No workaround that I know of. If you could get correct information then jQuery could as well.
comment:4 Changed 9 years ago by
Resolution: | → cantfix |
---|---|
Status: | new → closed |
Unfortunately I don't think any browser gives good position/offset results when the page is zoomed, and doesn't expose any scaling factor to let us determine the right values. This has existed forever and I've got a PR to address it that should land soon. https://github.com/jquery/api.jquery.com/issues/76