将js onmousemove转换为触及ios

时间:2013-11-03 20:56:30

标签: javascript ios html5

我正在尝试将HTLM5转换为iOS移动版,使用触摸而不是鼠标来播放。以与onmousemove相同的方式访问触摸的最佳方式是什么?

鼠标代码:

document.onmousemove = function(e){
    if (player.X + c.offsetLeft > e.pageX) {
        player.moveLeft();
    } else if (player.X + c.offsetLeft < e.pageX) {
        player.moveRight();
    }

}

0 个答案:

没有答案