diff --git a/jquery.ui.touch-punch.js b/jquery.ui.touch-punch.js index 16ce41d..8fe3433 100755 --- a/jquery.ui.touch-punch.js +++ b/jquery.ui.touch-punch.js @@ -80,7 +80,7 @@ touchHandled = true; // Track movement to determine if interaction was a click - self._touchMoved = false; + self._touchMoved = 0; // Simulate the mouseover event simulateMouseEvent(event, 'mouseover'); @@ -103,8 +103,8 @@ return; } - // Interaction was not a click - this._touchMoved = true; + // Interaction was less likely to be a click + this._touchMoved +=1; // Simulate the mousemove event simulateMouseEvent(event, 'mousemove'); @@ -127,8 +127,8 @@ // Simulate the mouseout event simulateMouseEvent(event, 'mouseout'); - // If the touch interaction did not move, it should trigger a click - if (!this._touchMoved) { + // If the touch interaction did not move (much), it should trigger a click + if (this._touchMoved<=5) { // Simulate the click event simulateMouseEvent(event, 'click'); @@ -177,4 +177,4 @@ _mouseDestroy.call(self); }; -})(jQuery); \ No newline at end of file +})(jQuery);