Open koenpopma opened 7 years ago
@koenpopma
I've the same problem here. Looking into it, it turned out that Firefox returns true for 'ontouchstart' in window
, at least in Windows 10 X64, while other desktop browsers return false, so that SUPPORTS_TOUCH
is somehow faked enabled. Hence touch simulation is disabled in Firefox from line 461 of current jquery.touchSwipe.js.
BTW, determining if user device has touch ability is not that simple. May be refining SUPPORTS_TOUCH
detection with something like:
SUPPORTS_TOUCH = 'ontouchstart' in window & navigator.maxTouchPoints
could be a more reliable approach, even if it returns 1/0 instead of true/false.
Hi @mattbryson, this is very interesting I suppose: https://codeburst.io/the-only-way-to-detect-touch-with-javascript-7791a3346685
In my application, swipe is initialized only after an user action, so the onFirstTouch
event described in the link above works like a charm for me. I've no idea if there could be a way to delay initialization after first interaction for every possible use of the script (probably not).
Ill look at this as part of the next release that re works the event model
Hi, I'm back here just to say that in a newer version of Firefox dragging works as expected. Tested on Firefox 78.0.2 (64 bits).
Trying to create a draggable slider with swipe functionalities attached;
On Safari (536.25), Chrome (44.0.2403.89 Safari/537.36) dragging works, with this setup:
... and on Mozilla FireFox (48.0) it —the dragging— does not work?!?
This event is not even listed in the console... ?!?
Is there a bug at the cursor-event? Can someone help me to fix this?
PS: Even this is not in the console at Mozilla FireFox 48.0 (while it is in the other browsers):
Like this isn't even triggered ?!?