ionic 手势事件
| 事件 | �述 | 用法 | 实例 |
|---|---|---|---|
| on-hold | 长按的时间是500毫秒。 | <button on-hold="onHold()" class="button"> Test </button> |
�试一下 » |
| on-tap | 这个是手势轻击事件,如果长按时间超过250毫秒,那就�是轻击了。。 | <button on-tap="onTap()" class="button"> Test </button> |
�试一下 » |
| on-double-tap | 手�击�幕事件 | <button on-double-tap="onDoubleTap()" class="button"> Test </button> |
�试一下 » |
| on-touch | 这个和 on-tap 还是有区别的,这个是立å�³æ‰§è¡Œï¼Œè€Œä¸”是用户点击立马执行。ä¸�用ç‰å¾… touchend/mouseup 。 | <button on-touch="onTouch()" class="button"> Test </button> |
�试一下 » |
| on-release | 当用户结�触摸事件时触�。 | <button on-release="onRelease()" class="button"> Test </button> |
�试一下 » |
| on-drag | 这个有点类似于PCç«¯çš„æ‹–æ‹½ã€‚å½“ä½ ä¸€ç›´ç‚¹å‡»æŸ�个物体,并且手开始移动,都会触å�‘ on-drag。 | <button on-drag="onDrag()" class="button"> Test </button> |
�试一下 » |
| on-drag-up | �上拖拽。 | <button on-drag-up="onDragUp()" class="button"> Test </button> |
�试一下 » |
| on-drag-right | ��拖拽。 | <button on-drag-right="onDragRight()" class="button"> Test </button> |
�试一下 » |
| on-drag-down | �下拖拽。 | <button on-drag-down="onDragDown()" class="button"> Test </button> |
�试一下 » |
| on-drag-left | �左边拖拽。 | <button on-drag-left="onDragLeft()" class="button"> Test </button> |
�试一下 » |
| on-swipe | 指手指滑动效果,�以是任何方�上的。而且也和 on-drag 类似,都有四个方�上�独的事件。 | <button on-swipe="onSwipe()" class="button"> Test </button> |
�试一下 » |
| on-swipe-up | �上的手指滑动效果。 | <button on-swipe-up="onSwipeUp()" class="button"> Test </button> |
�试一下 » |
| on-swipe-right | ��的手指滑动效果。 | <button on-swipe-right="onSwipeRight()" class="button"> Test </button> |
�试一下 » |
| on-swipe-down | �下的手指滑动效果。 | <button on-swipe-down="onSwipeDown()" class="button"> Test </button> |
�试一下 » |
| on-swipe-left | �左的手指滑动效果。 | <button on-swipe-left="onSwipeLeft()" class="button"> Test </button> |
�试一下 » |
$ionicGesture
一个angular�务展示ionicionic.EventController手势。
方法
on(eventType, callback, $element)
åœ¨ä¸€ä¸ªå…ƒç´ ä¸Šæ·»åŠ ä¸€ä¸ªäº‹ä»¶ç›‘å�¬å™¨ã€‚
| �数 | 类型 | 详情 |
|---|---|---|
| eventType |
string
|
监�的手势事件。 |
| callback |
function(e)
|
当手势事件�生时触�的事件。 |
| $element |
element
|
angularå…ƒç´ ç›‘å�¬çš„事件。 |
| options |
object
|
对象。 |
off(eventType, callback, $element)
åœ¨ä¸€ä¸ªå…ƒç´ ä¸Šç§»é™¤ä¸€ä¸ªæ‰‹åŠ¿äº‹ä»¶ç›‘å�¬å™¨ã€‚
| �数 | 类型 | 详情 |
|---|---|---|
| eventType |
string
|
移除监�的手势事件。 |
| callback |
function(e)
|
移除监�器。 |
| $element |
element
|
被监å�¬äº‹ä»¶çš„angularå…ƒç´ ã€‚ |
点我分享笔记