26

While scrolling in Mobile Safari, the first touchstart, touchmove, and touchend events are fired, however, if you're still scrolling additional touch events are not fired.

For my application this is problematic because a user can stop the scroll with their finger and I can't tell if there is a finger down. When a finger is down you can't set scrollTop of the window or rather you can set it, and it changes, but the window doesn't scroll. When the user moves their finger again it starts scrolling not from where I set the scrollTop but to whether their finger was put down.

Please no comments on why I want to change the scrollTop of the window; let's just accept that as an a priority requirement. Any thoughts for how to detect if there is a finger down?

user7637745
  • 965
  • 2
  • 14
  • 27
overgroove
  • 948
  • 1
  • 7
  • 15

2 Answers2

1

how about using "detect click on mousedown" like technic? something like:

var touchStart = false;

function onTouchStart() {
   touchStart = true;
}
function onTouchEnd() {
   touchStart = false;
}
function someFunction() {
   if (touchStart) ...;
   else ...;
}
MakeLoveNotWar
  • 956
  • 9
  • 25
0

You cannot handle touch events when iOs momentum scrolling is active. This also prevents developers from disabling iOs zoom.

nicopowa
  • 459
  • 3
  • 11