完全错误:
[Intervention] Ignored attempt to cancel a touchend event with cancelable=false, for example because scrolling is in progress and cannot be interrupted.
preventDefault @ jquery.min.js:2
(anonymous) @ number_grid_game.php:239
each @ jquery.min.js:2
(anonymous) @ number_grid_game.php:234
dispatch @ jquery.min.js:2
y.handle @ jquery.min.js:2
我有一个使用触摸事件的代码。当我开始拖动时,最初 10-30 步是正常的,但在 30-35 步之后,拖动变得缓慢且难以拖动。我不确定是什么导致了这个问题,我是处理触摸事件的新手,似乎无法解决这个问题。这是处理触摸事件的代码:
$(window)
.on('touchstart', function(event) {
var missingNumbers, $target = $(event.target);
if(!$target.hasClass('missing-number'))
return;
missingNumbers = MissingNumbers.ByElement($target);
//185
$.each(event.originalEvent.changedTouches, function(index, touch) {
event.preventDefault();
event.stopPropagation();
missingNumbers.startDrag($target, touch.identifier, touch.pageX, touch.pageY);
});
})
.on('touchmove', function(event) {
$.each(event.originalEvent.changedTouches, function(index, touch) {
var touchId = touch.identifier;
if((touchId in MissingNumbers.DraggedElements)) {
event.preventDefault();
event.stopPropagation();
MissingNumbers.DoCellDrag(touchId, touch.pageX, touch.pageY);
}
});
})
.on('touchend', function(event) {
$.each(event.originalEvent.changedTouches, function(index, touch) {
var touchId = touch.identifier;
if((touchId in MissingNumbers.DraggedElements)) {
event.preventDefault();
event.stopPropagation();
MissingNumbers.EndCellDrag(touchId);
}
});
});
任何解决方案将不胜感激