私が試した解決策は、ドキュメントにeventListenersを追加することです:
document.addEventListener("touchstart", touchStart, "true");
document.addEventListener("touchmove", touchMove, "true");
document.addEventListener("touchend", touchEnd, "true");
次に、それぞれと入力してください。タッチイベントです。私はこれがなぜなら、場所(通常のイベント処理のような)を持つイベント自体ではなく、位置を持つ一連のタッチだからです。
function touchMove(event)
{
// // Prevent the webview itself from scrolling/bouncing around
event.preventDefault();
// Only track one finger
if (event.touches.length == 1)
{
var touch = event.touches[0];
doStuffAtPosition(touch.pageX, touch.pageY);
}
}