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 還是有區(qū)別的,這個是立即執(zhí)行,而且是用戶點(diǎn)擊立馬執(zhí)行。不用等待 touchend/mouseup 。 | <button on-touch="onTouch()" class="button"> Test </button> |
嘗試一下 ? |
on-release | 當(dāng)用戶結(jié)束觸摸事件時觸發(fā)。 | <button on-release="onRelease()" class="button"> Test </button> |
嘗試一下 ? |
on-drag | 這個有點(diǎn)類似于PC端的拖拽。當(dāng)你一直點(diǎn)擊某個物體,并且手開始移動,都會觸發(fā) 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 類似,都有四個方向上單獨(dú)的事件。 | <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服務(wù)展示ionicionic.EventController手勢。
方法
on(eventType, callback, $element)
在一個元素上添加一個事件監(jiān)聽器。
參數(shù) | 類型 | 詳情 |
---|---|---|
eventType |
string
|
監(jiān)聽的手勢事件。 |
callback |
function(e)
|
當(dāng)手勢事件發(fā)生時觸發(fā)的事件。 |
$element |
element
|
angular元素監(jiān)聽的事件。 |
options |
object
|
對象。 |
off(eventType, callback, $element)
在一個元素上移除一個手勢事件監(jiān)聽器。
參數(shù) | 類型 | 詳情 |
---|---|---|
eventType |
string
|
移除監(jiān)聽的手勢事件。 |
callback |
function(e)
|
移除監(jiān)聽器。 |
$element |
element
|
被監(jiān)聽事件的angular元素。 |
更多建議: