diff --git a/jquery.ui.touch-punch.js b/jquery.ui.touch-punch.js index 16ce41d..3f30ea3 100755 --- a/jquery.ui.touch-punch.js +++ b/jquery.ui.touch-punch.js @@ -61,6 +61,17 @@ // Dispatch the simulated event to the target element event.target.dispatchEvent(simulatedEvent); + var target = event.target; + + // Dispatch the simulated event to the target element + if (simulatedType === 'mousemove') { + // Special handling for mouse move: fire on element at the current location instead: + var elementAtPoint = document.elementFromPoint(event.clientX, event.clientY); + if (elementAtPoint !== null) { + target = elementAtPoint; + } + } + target.dispatchEvent(simulatedEvent); } /** @@ -177,4 +188,4 @@ _mouseDestroy.call(self); }; -})(jQuery); \ No newline at end of file +})(jQuery);