benmajor / jQuery-Touch-Events

A collection of mobile event plugins for jQuery.
MIT License
699 stars 225 forks source link

Variables touch.position.x and touch.position.y report incorrect values #125

Closed lexming closed 6 years ago

lexming commented 7 years ago

The variables touch.position.x and touch.position.y report incorrect values on Chrome browser on Android. This issue stems from the readings pulled from e.originalEvent.touches[0].screenX and e.originalEvent.touches[0].screenY, which do not correlate with the real size of the window/screen. Using e.originalEvent.touches[0].pageX and .originalEvent.touches[0].pageY fixes the problem on Chrome and also works on Firefox. Not tested in other browsers.

benmajor commented 7 years ago

Thanks, I'll add this to the fix list for the next release.

benmajor commented 6 years ago

This is now fixed with the release of v2.0.0. See https://github.com/benmajor/jQuery-Touch-Events/commit/8cbaed748d61da88d367a7e19ed08f4b7707c300