在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.有什么帮助吗。
发布于 2015-11-04 14:44:28
您可以使用内置的离子手势来跟踪各种触摸事件,如:hold、tap、doubletap、drag、dragstart、dragend、dragup、dragdown、dragleft、dragright、swipe、swipeup、d12、d13、swiperight、d15、d16、transformend、d18、d19、pinchin、d21/code>、代码>、<代码><代码>。
在您的例子中,我认为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)
})
}]);关于http://ionicframework.com/docs/api/utility/ionic.EventController/的更多细节
https://stackoverflow.com/questions/33522526
复制相似问题