ionic gesture event
Event | Description | Usage | Example |
##on-hold | The long press time is 500 milliseconds. | <button
on-hold="onHold()"
class="button">
Test
</button>
| Try it» |
on-tap | This is a gesture tap event, If the long press lasts longer than 250 milliseconds, it's not a tap. . | <button
on-tap="onTap()"
class="button">
Test
</button>
| Try it» |
on-double-tap | Hand double-tap screen event | <button
on-double-tap="onDoubleTap()"
class="button">
Test
</button>
| Try it» |
on-touch | There is still a difference between this and on-tap Yes, this is executed immediately, and it is executed immediately when the user clicks. No need to wait for touchend/mouseup. | <button on-touch="onTouch()"
class="button">
Test
</button>
| Try it » |
on-release | Fires when the user ends the touch event . | <button
on-release="onRelease()"
class="button">
Test
</button>
| Try it» |
on-drag | This is somewhat similar to drag on the PC Pull. When you keep clicking on an object and your hand starts to move, on-drag will be triggered. | <button
on-drag="onDrag()"
class="button">
Test
</button>
| Try it » |
on-drag-up | Drag up. | <button
on-drag-up="onDragUp()"
class="button">
Test
</button>
| Try it » |
on-drag-right | Drag right. | <button
on-drag-right="onDragRight()"
class="button">
Test
</button>
| Try it » |
on-drag-down | Drag down. | <button
on-drag-down="onDragDown()"
class="button">
Test
</button>
| Try it » |
##on-drag-leftDrag to the left. | <button
on-drag-left="onDragLeft()"
class="button">
Test
</button> | | Try it» |
on-swipe refers to the finger sliding effect, which can be in any direction. And similar to on-drag, there are separate events in four directions. | <button
on-swipe="onSwipe()"
class="button">
Test
</button> | | Try it» |
on-swipe-upUp finger swipe effect . | <button
on-swipe-up="onSwipeUp()"
class="button">
Test
</button> | | Try it » |
on-swipe-rightSwipe your finger to the right Effect. | <button
on-swipe-right="onSwipeRight()"
class="button">
Test
</button> | Try it » |
on-swipe-down | Down finger swipe Effect. | <button
on-swipe-down="onSwipeDown()"
class="button">
Test
</button> | Try it» |
on-swipe-left | Swipe your finger to the left Effect. | <button
on-swipe-left="onSwipeLeft()"
class="button">
Test
</button> | Try it» |
##$ionicGesture
an angular The service displays the ionicionic.EventController gesture.
Method
on(eventType, callback, $element)
Add an event listener on an element.
Parameters | Type | Details |
eventType | string
| Gesture events to listen for. |
callback | function(e)
| Event triggered when a gesture event occurs. |
$element | element
| Events listened by angular elements. |
options | object
| Object. |
off(eventType, callback, $element)
Remove a gesture event listener on an element.
Parameters | Type | Details |
eventType | string
| Remove the monitored gesture event. |
callback | function(e)
| Remove the listener. |
$element | element
| The angular element that is listening for the event. |