我有一个被调用的函数,touchmove
我需要找出鼠标移动的方向。请求的值是“左”和“右”。在不使用任何插件的情况下如何做到这一点?
document.addEventListener('touchmove',
function(event, direction, distance, duration, fingerCount) {
if(direction == 'left'){
my.MouseWheel.handle(-1);
} else if (direction == 'right'){
my.MouseWheel.handle(1);
}
});