【问题标题】:swipe-down event not firing - ionic framework向下滑动事件未触发 - 离子框架
【发布时间】:2014-07-20 17:42:33
【问题描述】:

我正在使用 ionic 框架创建一个简单的应用程序,并且我想在每个滑动事件上运行一个函数。向上、向下、向左和向右滑动。

    <ion-content on-swipe-up="add()" on-swipe-left="multiply()" on-swipe-right="divide()" on-swipe-down="subtract()" scroll="false">
    <div id="game">
        <h1>{{subject.value}}</h1> 
    </div>
</ion-content>

所有事件都可以正常工作,除了向下滑动。无论我做什么,我都无法触发该事件。我已经尝试了我能想到的一切:设置滚动属性,将事件附加到不同的元素,模拟而不是在浏览器中,并制作了一个新的基本项目,我只是在测试向下滑动事件.没有任何效果。

CorePen

【问题讨论】:

标签: javascript angularjs ionic-framework


【解决方案1】:

看起来有一个错误。

我提交了一个 Github 问题。 https://github.com/driftyco/ionic/issues/1810

同时,如果您使用 bundle.js 文件的本地副本,请进行以下更改:

第 40918 行,更改:

'onHold onTap onTouch onRelease onDrag onDragUp onDragRight onDragDown onDragLeft onSwipe onSwipeUp onSwipeRight onSwipeBottom onSwipeLeft'.split(' '),

'onHold onTap onTouch onRelease onDrag onDragUp onDragRight onDragDown onDragLeft onSwipe onSwipeUp onSwipeRight onSwipeDown onSwipeLeft'.split(' '),

【讨论】:

  • 谢谢!!现在完美运行。当发生这种情况时,需要记住更仔细地查看源代码。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-08-08
  • 2014-06-17
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多