在手机上处理正常的touchstart,touchmove,touchend事件,在windows8触摸屏上就不行了,会触发整个网页的上下滚动(touchmove中已经event.preventDefault())不再触发touchmove事件
var canvas = $('#canvas');
canvas.on('touchstart', onTouchStart);
$(document).on('touchend', onTouchEnd);
function onTouchStart(event) {
event.preventDefault();
//do something
canvas.on('touchmove', onTouch);
}
function onTouchMove(event) {
//手机上正常阻止浏览器滑动的代码,在win8触摸屏上失效了
event.preventDefault && event.preventDefault();
//do something
}
function onTouchEnd(event) {
event.preventDefault();
canvas.off('touchend', onTouchMove);
}
1
del1214 OP 自己先顶一下
|
2
forte 2015-05-07 12:18:32 +08:00 via iPhone 1
CSS touch action: none
另外IE是用 pointer events |