[英]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.