Web应用程序可以收集iPhone的加速计数据吗?如果是这样,怎么样?我认为他们可能会在Safari Web浏览器中使用具有此类功能的API。Web应用程序可以收集iPhone的加速计数据吗?如果是这样,怎么样?
如果可能有人可以给我一个链接到具有特定编码信息的页面。
Web应用程序可以收集iPhone的加速计数据吗?如果是这样,怎么样?我认为他们可能会在Safari Web浏览器中使用具有此类功能的API。Web应用程序可以收集iPhone的加速计数据吗?如果是这样,怎么样?
如果可能有人可以给我一个链接到具有特定编码信息的页面。
找到这个片段从here与谷歌搜索。
window.ondevicemotion = function(event) {
ax = event.accelerationIncludingGravity.x
ay = event.accelerationIncludingGravity.y
az = event.accelerationIncludingGravity.z
rotation = event.rotationRate;
if (rotation != null) {
arAlpha = Math.round(rotation.alpha);
arBeta = Math.round(rotation.beta);
arGamma = Math.round(rotation.gamma);
}
}
入住这http://stackoverflow.com/questions/433543/iphone-accelerometer-in-web-applications – Jhaliya