Overview
The pan gesture recognizes pointer movement across the screen. Unlike drag, pan doesn’t move the element but provides detailed information about the pointer movement for custom implementations. Note: For pan gestures to work correctly with touch input, the element needs touch scrolling to be disabled on either x/y or both axes with thetouch-action CSS rule.
Event Handlers
onPan
Callback function that fires when the pan gesture is recognized on this element.point: Relative to the device or pagedelta: Distance moved since the last eventoffset: Offset from the original pan eventvelocity: Current velocity of the pointer (in px/ms)
onPanStart
Callback function that fires when the pan gesture begins on this element.onPanEnd
Callback function that fires when the pan gesture ends on this element.onPanSessionStart
Callback function that fires when we begin detecting a pan gesture. This is analogous toonMouseStart or onTouchStart.
Examples
Custom slider
Track swipe velocity
Pan-based drawing
PanInfo Properties
point
Containsx and y values for the current pan position relative to the device or page.
delta
Containsx and y values for the distance moved since the last event.
offset
Containsx and y values for the distance moved from the first pan event.
velocity
Containsx and y values for the current velocity of the pointer, in px/ms.