Iphone's safari touchmove event not working

Active3 hr before
Viewed126 times

5 Answers


Thanks for contributing an answer to Stack Overflow!, Stack Overflow for Teams Where developers & technologists share private knowledge with coworkers , Fast intercontinental Remote Desktop Sessions ,Stack Overflow en español

Try using e.originalEvent.touches:

$('#movieShow').bind('touchmove', function(e) {

   var touch = e.originalEvent.touches[0] || e.originalEvent.changedTouches[0];
load more v

Does the touchmove event NOT work on the iPhone’s Safari browser?I’m not talking about an iOS App, just a regular old HTML page with some Javascript and jQuery that’s loaded into the iPhone’s Safari Browser.,I actually connected my iPhone to my Mac-mini – which is also running Safari, so I can see everything that’s happening on the iPhone in the Mac-Mini’s Safari console – and my touchstart and touchend events DO fire, but touchmove just does NOT respond.,I can’t see any other way of tackling this unless touchmove starts playing nicely.,What I’m ultimately trying to do is get a custom pinch-zoom type behavior going, and my understanding is that this has to be implemented in the touchmove event – so that’s why I’m asking.

Here’s the code:

        document.addEventListener("touchstart", onMobileTouchStart, false);
        document.addEventListener("touchmove", onMobileTouchMove, false);
        document.addEventListener("touchend", onMobileTouchEnd, false);

        function onMobileTouchStart(touchStartEvent) {

        function onMobileTouchMove(moveEvent) {

        function onMobileTouchEnd(touchEndEvent) {

It looks like the workaround,doesn't work anymore with iOS 11.3 Mobile Safari. Is there a new workaround? 😅 It looks like that the same issue applies to Chrome on iOS as well.,If you're targeting this code to Safari iOS11.3 than it's perfectly valid since its supporting the new addEventListener api.,I'll take a look if the detection for passive event listeners works for iOS 11.3 - if it does already apply { passive:false } and it still does not work than this is going to be a fun thing for anybody trying to prevent touchmove do its thing 😞

window.addEventListener('touchmove', function() {});
load more v

Попробуйте использовать e.originalEvent.touches : , Что такое событие 'touchmove'? , Можно ли использовать UDP в Flash/ActionScript? ,Попробуйте это и посмотрите, не получите ли вы по-прежнему никаких результатов:

я использую событие jquery и touchmove, но код ничего не показывает в #info

$('#movieShow').bind('touchmove', function(e) {
load more v

A Boolean value indicating whether or not the alt key was down when the touch event was fired.,A Boolean value indicating whether or not the shift key was down when the touch event was fired.,A Boolean value indicating whether or not the meta key was down when the touch event was fired.,A Boolean value indicating whether or not the control key was down when the touch event was fired.

load more v