每当触发touchmove事件时,我都会尝试执行一些代码。然而,touchmove事件现在是非常错误的。在许多浏览器中,包括Android浏览器和Chrome 34。
A "solution" does exist尝试“修复”这个问题:
$('html').on('touchmove', function(e) {
e.preventDefault();
//...
});通过添加preventDefault,它将导致浏览器更新事件。然而,它也停止了所有我并不真正想要的touchmove事件。
有没有办法可以修复这个bug,但不会取消事件?谢谢。
发布于 2014-03-24 10:58:01
我相信你还需要更多的东西,我认为答案就是协调地使用所有其他事件并管理“活动”状态。
el.on('touchstart mousedown', function(e) ...
el.on('touchcancel', function(e) ...
el.on('touchmove mousemove', function(e) ...
el.on('touchend mouseup', function(e) ...我使用angular-touch做了一些事情,他们似乎在解决同样的问题,值得看看一些示例代码。https://github.com/angular/bower-angular-touch/blob/master/angular-touch.js#L122
https://stackoverflow.com/questions/22599618
复制相似问题