课程表

ionic 准备

ionic CSS

ionic JavaScript

工具箱
速查手册

ionic 手势事件

当前位置:免费教程 » 移动开发 » ionic
事件 描述 用法 实例
on-hold 长按的时间是500毫秒。
  1. <button
  2. on-hold="onHold()"
  3. class="button">
  4. Test
  5. </button>
尝试一下 »
on-tap 这个是手势轻击事件,如果长按时间超过250毫秒,那就不是轻击了。。
  1. <button
  2. on-tap="onTap()"
  3. class="button">
  4. Test
  5. </button>
尝试一下 »
on-double-tap 手双击屏幕事件
  1. <button
  2. on-double-tap="onDoubleTap()"
  3. class="button">
  4. Test
  5. </button>
尝试一下 »
on-touch 这个和 on-tap 还是有区别的,这个是立即执行,而且是用户点击立马执行。不用等待 touchend/mouseup 。
  1. <button on-touch="onTouch()"
  2. class="button">
  3. Test
  4. </button>
尝试一下 »
on-release 当用户结束触摸事件时触发。
  1. <button
  2. on-release="onRelease()"
  3. class="button">
  4. Test
  5. </button>
尝试一下 »
on-drag 这个有点类似于PC端的拖拽。当你一直点击某个物体,并且手开始移动,都会触发 on-drag。
  1. <button
  2. on-drag="onDrag()"
  3. class="button">
  4. Test
  5. </button>
尝试一下 »
on-drag-up 向上拖拽。
  1. <button
  2. on-drag-up="onDragUp()"
  3. class="button">
  4. Test
  5. </button>
尝试一下 »
on-drag-right 向右拖拽。
  1. <button
  2. on-drag-right="onDragRight()"
  3. class="button">
  4. Test
  5. </button>
尝试一下 »
on-drag-down 向下拖拽。
  1. <button
  2. on-drag-down="onDragDown()"
  3. class="button">
  4. Test
  5. </button>
尝试一下 »
on-drag-left 向左边拖拽。
  1. <button
  2. on-drag-left="onDragLeft()"
  3. class="button">
  4. Test
  5. </button>
尝试一下 »
on-swipe 指手指滑动效果,可以是任何方向上的。而且也和 on-drag 类似,都有四个方向上单独的事件。
  1. <button
  2. on-swipe="onSwipe()"
  3. class="button">
  4. Test
  5. </button>
尝试一下 »
on-swipe-up 向上的手指滑动效果。
  1. <button
  2. on-swipe-up="onSwipeUp()"
  3. class="button">
  4. Test
  5. </button>
尝试一下 »
on-swipe-right 向右的手指滑动效果。
  1. <button
  2. on-swipe-right="onSwipeRight()"
  3. class="button">
  4. Test
  5. </button>
尝试一下 »
on-swipe-down 向下的手指滑动效果。
  1. <button
  2. on-swipe-down="onSwipeDown()"
  3. class="button">
  4. Test
  5. </button>
尝试一下 »
on-swipe-left 向左的手指滑动效果。
  1. <button
  2. on-swipe-left="onSwipeLeft()"
  3. class="button">
  4. Test
  5. </button>
尝试一下 »

$ionicGesture

一个angular服务展示ionicionic.EventController手势。

方法

  1. on(eventType, callback, $element)

在一个元素上添加一个事件监听器。

参数 类型 详情
eventType string

监听的手势事件。

callback function(e)

当手势事件发生时触发的事件。

$element element

angular元素监听的事件。

options object

对象。

  1. off(eventType, callback, $element)

在一个元素上移除一个手势事件监听器。

参数 类型 详情
eventType string

移除监听的手势事件。

callback function(e)

移除监听器。

$element element

被监听事件的angular元素。

转载本站内容时,请务必注明来自W3xue,违者必究。
 友情链接:直通硅谷  点职佳  北美留学生论坛

本站QQ群:前端 618073944 | Java 606181507 | Python 626812652 | C/C++ 612253063 | 微信 634508462 | 苹果 692586424 | C#/.net 182808419 | PHP 305140648 | 运维 608723728

W3xue 的所有内容仅供测试,对任何法律问题及风险不承担任何责任。通过使用本站内容随之而来的风险与本站无关。
关于我们  |  意见建议  |  捐助我们  |  报错有奖  |  广告合作、友情链接(目前9元/月)请联系QQ:27243702 沸活量
皖ICP备17017327号-2 皖公网安备34020702000426号