给定
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 方向?