mattbryson / TouchSwipe-Jquery-Plugin

TouchSwipe is a jquery plugin to be used with jQuery on touch input devices such as iPad, iPhone etc.
http://labs.rampinteractive.co.uk/touchSwipe/
Other
4.05k stars 1.68k forks source link

Swipe script doesnot work, when using any of touch devices with pluged mouse. #180

Open Vadimzem opened 10 years ago

Vadimzem commented 10 years ago

The script does not work if the mouse is connected to any touch device (tablet, touch monitor).

This bug fires only in Chrome. In FF it's fine.

Vadimzem commented 10 years ago

I found the problem, in Chrome all condition: if (!SUPPORTS_TOUCH)... return TRUE when you using pluged mouse. In FF it return FALSE.

You need to check if touch event is undefined.

if ((!SUPPORTS_TOUCH || typeof event.touches === "undefined") This condition will solve the problem.

jdalton commented 9 years ago

:+1: the SUPPORTS_TOUCH checks could be replaced with event.touches truthy checks.