diff --git a/jquery.ui.touch-punch.js b/jquery.ui.touch-punch.js index 2766f41..a5faaca 100755 --- a/jquery.ui.touch-punch.js +++ b/jquery.ui.touch-punch.js @@ -39,6 +39,9 @@ var touch = event.originalEvent.changedTouches[0], simulatedEvent = document.createEvent('MouseEvents'); + var zoomRatio=b("body").css("zoom"); + if(isNaN(zoomRatio))zoomRatio=1; + // Initialize the simulated mouse event using the touch event's coordinates simulatedEvent.initMouseEvent( simulatedType, // type @@ -46,10 +49,10 @@ true, // cancelable window, // view 1, // detail - touch.screenX, // screenX - touch.screenY, // screenY - touch.clientX, // clientX - touch.clientY, // clientY + touch.screenX / zoomRatio, // screenX + touch.screenY / zoomRatio, // screenY + touch.clientX / zoomRatio, // clientX + touch.clientY / zoomRatio, // clientY false, // ctrlKey false, // altKey false, // shiftKey @@ -157,4 +160,4 @@ _mouseInit.call(self); }; -})(jQuery); \ No newline at end of file +})(jQuery);