Safari iOS陀螺仪光标

时间:2012-08-02 19:50:27

标签: javascript ios safari webkit

鉴于

    var pointer = document.getElementById("pointer");

    window.ondeviceorientation = function(event) {
      ax = Math.round(event.alpha);
      ay = Math.round(event.beta);
      az = Math.round(event.gamma);
    }

    setInterval(function() {

            // ???

            pointer.style.left = x + "px"; 
            pointer.style.top = y + "px"; 
    }, 25);

移动'指针'的正确功能是什么,以便它可以相应地移动到iphone方向?

0 个答案:

没有答案
相关问题