Questions tagged [touchmove]
140 questions
36
votes
3 answers
Can't prevent `touchmove` from scrolling window on iOS
We are trying to scroll an element on our iOS web app while preventing the window itself from scrolling. We are capturing the touchmove event on the window, scrolling the element programmatically and (trying to) prevent the window itself from scroll…

Matthew Gertner
- 4,487
- 2
- 32
- 54
33
votes
3 answers
When to use touchmove vs mousemove?
I build a web mobile game, it runs on browsers (PC/Mobile).
Do I need to use the touchmove or not?
How can I run the touchmove event like the mousemove event?

Soliman
- 1,132
- 3
- 12
- 32
17
votes
2 answers
-webkit-overflow: touch; stops working when tapping on element outside of scroll container
I have a really big bug on the iphone, that makes a page unusable and I just can't solve it. I can't find any topic about this issue as well.
I have the following screen:
In the middle, there is a div, which is set on -webkit-overflow: auto; to…

user3561012
- 273
- 3
- 8
16
votes
3 answers
JavaScript DOM changes in touchmove delayed until scroll ends on mobile Safari
In mobile safari, in the course of handling touchmove for an element, I change the className of that element. Unfortunately, the visual change does not occur while the user is scrolling, or until the very end of an inertial scroll.
What can I do to…

Hilton Campbell
- 6,065
- 3
- 47
- 79
12
votes
4 answers
multiple touches: touchend event fired only when a touchmove occurs
I would like to add some multitouch features to my javascript application when it is accessed from an ios device (and maybe android later).
I want to provide a shiftkey-like functionality: the user may hold a button on the screen with one finger,…

Louis
- 397
- 2
- 14
9
votes
2 answers
Unable to stop the scrolling of the outer div when end of inner div has reached
Use Case : - If the user is scrolling an inner div it should not scroll the outer div once inner div end has reached.
The following code works perfectly fine if the inner div has already reached the end. i.e the touchstart/touchmove event triggers…

Keen Sage
- 1,899
- 5
- 26
- 44
9
votes
4 answers
Cancel touchend if touchmove fires
I'm building something mainly for use on tablets, where the user can tap an item on the screen and a class is applied to it. This is what I have so far:
The problems:
I want to use touch events to remove the class and add the class on touch end (to…

mmm
- 2,272
- 3
- 25
- 41
8
votes
1 answer
Leaflet JS - Implementing Gesture Handling to enforce 2 fingered scrolling
You know when you're on a mobile device and you scroll down a web page which has a google map. The map goes dark and tells you "Use two fingers to move the map".
I want to implement exactly this in my Leaflet map. Leaflet doesn't currently offer…

elMarquis
- 7,450
- 4
- 38
- 42
7
votes
1 answer
event.pageX/Y not working on touchmove
Today I had the following thing going on: I had an existing mousemove event and added touchmove later on, like this:
$(window).on "mousemove touchmove", (e) ->
pos_x = e.pageX
pos_y = e.pageY
Unfortunately both variables were undefined on…

MyXoToD
- 620
- 5
- 13
7
votes
3 answers
How to synchronize the scroll offset of two elements during inertial scrolling
I need to keep the scroll offset of an element in sync with another (the window actually) and I'm having trouble doing so during the inertial "roll off" phase of scrolling on Mobile Safari (iPad).
I have a couple of divs with position:fixed;…

Tobia
- 17,856
- 6
- 74
- 93
6
votes
1 answer
Javascript stop scrolling on touchmove after scrolling has already started
I have a simple example where a user starts to scroll on a touch screen, and then after one second, I want to disable scrolling. I thought event.preventDefault() would stop the scrolling but it doesn't seem to work after scrolling has already…

user1763510
- 1,070
- 1
- 15
- 28
5
votes
2 answers
touchmove event not firing on google chrome for android
This is for a react "customer signature" component. The touchmove event is not firing on Google Chrome browser for Android. I am on a Samsung Galax Tablet a (2016). I have the tablet connected to my PC via USB for console.
In my componentDidMount I…

John
- 976
- 1
- 15
- 21
4
votes
1 answer
Android browsers not handling touchmove events correctly
When I try to inspect the touchmove event in this jsbin demo it only triggers once in Chrome and Opera for Android, and immediately after that, it triggers a touchcancel event, instead of continuing to trigger touchmove events?
Based on both the W3C…

Joeytje50
- 18,636
- 15
- 63
- 95
4
votes
1 answer
iOS touchmove event - changing backgroundPosition is not smooth
I'm trying to create simple parallax effect changing backround position but the movement is not smooth in iOS Safari. Background changes its position only when I release touchscreen, but not when I scroll it.
Javascript:
…

Anton A
- 41
- 4
3
votes
1 answer
HTML Drag and Drop on touchscreen
I am working on a Task which involves dragging of images and checking where it is dropping and performing action if it is dropped on right location. While it is working absolutely fine on anything that has a mouse it does not work on a touchscreen.…

Muhammad Usama Malik
- 55
- 1
- 4