Javascript 离子角姿态挤压碰撞ios
我正在尝试在我的应用程序中的Javascript 离子角姿态挤压碰撞ios,javascript,angularjs,ionic,hammer.js,Javascript,Angularjs,Ionic,Hammer.js,我正在尝试在我的应用程序中的#touchpad上监听一个挤压元素 我尝试过以下两种方法,这两种方法都可以在浏览器中使用(chrome和safari),但当加载到iOS上时,它们会中断其他js的运行 ionic.onGesture("pinch", function(e){ socket.emit("pinch", { scale: e.gesture.scale }) }, $document[0].querySelector("#touchpad") )
#touchpad
上监听一个挤压元素
我尝试过以下两种方法,这两种方法都可以在浏览器中使用(chrome和safari),但当加载到iOS上时,它们会中断其他js的运行
ionic.onGesture("pinch", function(e){
socket.emit("pinch", { scale: e.gesture.scale })
}, $document[0].querySelector("#touchpad") )
`
有没有人有过在iOS上为爱奥尼亚做捏手势的经验
下面是看似无关的控制台错误(通过safari/ios emulator捕获)
[Error]错误:undefined不是对象(正在计算“scope.buttons.length”)
(匿名函数)(ionic.bundle.js,第20434行)
(匿名函数)(ionic.bundle.js,第17384行)
$broadcast(ionic.bundle.js,第23549行)
(匿名函数)(socket.min.js,第7行)
(匿名函数)(socket.min.js,第7行)
(匿名函数)(ionic.bundle.js,第25050行)
completeOutstandingRequest(ionic.bundle.js,第13732行)
(匿名函数)(ionic.bundle.js,第14112行)
问题在于,在屏幕上呈现之前,我将侦听器添加到了#touchpad元素中
只有iOS似乎对此有问题。问题在于,在屏幕上呈现之前,我将侦听器添加到了#touchpad元素 只有iOS似乎对此有问题
touchpad = angular.element(document.getElementById("touchpad"));
$ionicGesture.on('pinch', function(e){
socket.emit("pinch", { scale: e.gesture.scale } );
}, touchpad);