Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/375.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript hammer.js处理touchmove吗?_Javascript_Mobile_Web_Touch_Hammer.js - Fatal编程技术网

Javascript hammer.js处理touchmove吗?

Javascript hammer.js处理touchmove吗?,javascript,mobile,web,touch,hammer.js,Javascript,Mobile,Web,Touch,Hammer.js,hammer.js是否只处理touchstart/touchend,而不处理touchmove 对于我的应用程序,我需要知道触摸的路径,细节越多越好 谢谢 Patrick要获取触摸移动数据,您需要使用平移或滑动。以下是pan的示例代码: var hammer = new Hammer(div); // this sets pan to behave similar to normal touch/mouse input // note that by setting the threshold

hammer.js是否只处理touchstart/touchend,而不处理touchmove

对于我的应用程序,我需要知道触摸的路径,细节越多越好

谢谢


Patrick

要获取触摸移动数据,您需要使用平移或滑动。以下是pan的示例代码:

var hammer = new Hammer(div);

// this sets pan to behave similar to normal touch/mouse input
// note that by setting the threshold to 0, pan will receive all inputs
hammer.get('pan').set({ direction: Hammer.DIRECTION_ALL, threshold: 0 }); 

hammer.on('panstart', touchstart);
hammer.on('panmove', touchmove);
hammer.on('panend', touchend);