【发布时间】:2012-12-05 05:18:18
【问题描述】:
我无法调试此问题:如果您在 iPad 上查看此 jfiddle,您会看到您可以单击每个圆圈来更改上面的内容。当您按住一个圆圈时,您会看到它变成绿色(图像交换)。
现在,用你的手指按住一个,然后向上拖动你的手指,或者在按住前一个的同时用另一个手指单击另一个环。现在,iPad 触摸事件变得混乱,绿色(touchstart)事件留在原地而不是离开。我们最终会看到多个圆圈卡在绿色中,这意味着 touchend 事件从未发生过。
有人以前见过这个问题,或者知道如何进行调试吗?
这个 sn-p 显示 touchstart/end 事件
applications.on('touchstart mouseover', function() {
writeMessage(messageLayer, 'touchstart applications circle');
this.setFill({ image: images.applicationshover});
layer.draw();
});
applications.on('touchend mouseout', function() {
writeMessage(messageLayer, 'Mouseup applications circle');
this.setFill({ image: images.applicationsimage});
layer.draw();
});
【问题讨论】:
-
即使在网站上的触摸教程上:html5canvastutorials.com/kineticjs/html5-canvas-mobile-events 在您的 ipad 上打开它,触摸红色圆圈,然后将手指拖开 — touchstart 事件会一直持续到您再次触摸该圆圈为止。也许有一些方法可以创建一个脚本,上面写着“如果 touchmove 离开画布,然后 touchend”?
标签: touch kineticjs touchstart