Skip to main content

Bug Tracker

Side navigation

#14742 closed bug (cantfix)

Opened January 31, 2014 05:53PM UTC

Closed February 24, 2014 03:26PM UTC

offset() and position() returns different value after touch gesture zoom in IE 10 and 11

Reported by: victor.huang@sk.lung.ca 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.

Attachments (0)
Change History (4)

Changed January 31, 2014 06:01PM UTC by dmethvin comment:1

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

Changed January 31, 2014 06:05PM UTC by victor.huang@sk.lung.ca comment:2

Replying to [comment:1 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?

Changed January 31, 2014 06:07PM UTC by dmethvin comment:3

No workaround that I know of. If you could get correct information then jQuery could as well.

Changed February 24, 2014 03:26PM UTC by dmethvin comment:4

resolution: → cantfix
status: newclosed