首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >javascript事件中“`touchmove`”的替换

javascript事件中“`touchmove`”的替换
EN

Stack Overflow用户
提问于 2015-11-04 12:55:31
回答 1查看 1K关注 0票数 1

在javascript事件中替代touchmove。一旦使用touchmove,就会收到如下警告。

代码语言:javascript
复制
'Touch.webkitRadiusX' is deprecated and will be removed in M47, around November 2015. Please use 'Touch.radiusX' instead.
ionic.js:1155 'Touch.webkitRadiusY' is deprecated and will be removed in M47, around November 2015. Please use 'Touch.radiusY' instead.
ionic.js:1155 'Touch.webkitRotationAngle' is deprecated and will be removed in M47, around November 2015. Please use 'Touch.rotationAngle' instead.
ionic.js:1155 'Touch.webkitForce' is deprecated and will be removed in M47, around November 2015. Please use 'Touch.force' instead.

有什么帮助吗。

EN

回答 1

Stack Overflow用户

发布于 2015-11-04 14:44:28

您可以使用内置的离子手势来跟踪各种触摸事件,如:holdtapdoubletapdragdragstartdragenddragupdragdowndragleftdragrightswipeswipeupd12、d13、swiperight、d15、d16、transformend、d18、d19、pinchin、d21/code>、代码>、<代码><代码>。

在您的例子中,我认为touchmove可以被drag事件取代。此事件为您返回x,y。

以下是如何使用:

控制器中的注入$ionicGesture依赖项。

代码语言:javascript
复制
myApp.controller('myCtrl', ['$ionicGesture', function($ionicGesture){
    $ionicGesture.on('drag', function (e) {
        //Your logic here.
        //You can use console.log(JSON.stringify(e, null, 2)) to check the object (x,y coors)
    })
}]);

关于http://ionicframework.com/docs/api/utility/ionic.EventController/的更多细节

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/33522526

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档