javascript - what are differences between touchmove and gesturechange? - Stack Overflow

admin2025-04-17  4

I originally wanted to track one-finger panning on mobile webkit (iOS/Android). I found Creating a "sticky" fixed-position item that works on iOS Safari and I saw gesturechange. But as far as I tried, gesturechange only seems to be fired for two-finger move. Then I found touchmove event and it seems I can use that.

  1. What are differences between touchmove and gesturechange?
  2. Is it right to use touchmove for detecting one-finger panning?

I originally wanted to track one-finger panning on mobile webkit (iOS/Android). I found Creating a "sticky" fixed-position item that works on iOS Safari and I saw gesturechange. But as far as I tried, gesturechange only seems to be fired for two-finger move. Then I found touchmove event and it seems I can use that.

  1. What are differences between touchmove and gesturechange?
  2. Is it right to use touchmove for detecting one-finger panning?
Share edited May 23, 2017 at 11:46 CommunityBot 11 silver badge asked Jun 6, 2012 at 19:55 beatakbeatak 9,62210 gold badges35 silver badges43 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 5

1.Touchmove, touchstart, touchend, touchcancel are part of the multi-touch sequence. A multi-touch sequence begins when a finger first touches the surface.

gesturechange, gesturestart, gestureend are still part of multi-touch sequence but they contain more precise objects. Not all devices support gesture events. They contain scaling and rotation information allowing gestures to be bined, if supported by the platform. If not supported, one gesture ends before another starts.

2.So if you are just aiming for one finger such as swipe or slider I would use just use the touchmove. Unless you really want to turn your swipe into a 3d effect or rotate it i would bine touchmove and gesturechange.

GL

source: https://developer.apple./library/safari/documentation/appleapplications/reference/safariwebcontent/HandlingEvents/HandlingEvents.html#//apple_ref/doc/uid/TP40006511-SW1

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1744857284a270904.html

最新回复(0)