[英]Alternate for `touchmove` in javascript event
替代JavaScript事件中的touchmove
。 一旦使用touchmove
收到如下警告。
'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.
请帮忙。
您可以使用内置的离子手势跟踪各种触摸事件,例如: hold
, tap
, doubletap
, drag
, dragstart
, dragend
, dragup
, dragdown
, dragleft
, dragright
, swipe
, swipeup
, swipedown
, swipeleft
, swiperight
, transform
, transformstart
, transformend
, rotate
, pinch
, pinchin
, pinchout
, touch
, release
。
就您而言,我认为touchmove
可以替换为drag
事件。 此事件为您返回x,y。
这是使用方法:
在您的控制器中:注入$ionicGesture
依赖项。
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)
})
}]);
在Ionic Docs网站上了解更多详细信息
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.