Chrome上的Javascript-如何从deviceorientationabsolute事件获取正确的标题值?
我正在尝试使用Chrome上的Javascript-如何从deviceorientationabsolute事件获取正确的标题值?,javascript,android,google-chrome,augmented-reality,Javascript,Android,Google Chrome,Augmented Reality,我正在尝试使用javascript在Android上的Google-Chrome中为使用地理位置的web应用检索absolute标题值 我正在收听新的设备定向绝对事件: if ('ondeviceorientationabsolute' in window) { window.addEventListener("deviceorientationabsolute", ondeviceorientationabsolute, true); } else if ('ondeviceorien
javascript
在Android
上的Google-Chrome
中为使用地理位置的web应用检索absolute标题值
我正在收听新的设备定向绝对事件:
if ('ondeviceorientationabsolute' in window) {
window.addEventListener("deviceorientationabsolute", ondeviceorientationabsolute, true);
}
else if ('ondeviceorientation' in window) {
window.addEventListener("deviceorientation", ondeviceorientation, true);
}
成功调用相应的方法:
if (event.absolute === true) {
if (event.alpha === null) {
return;
}
console.log('absolute: ' + event.absolute) // true
console.log('alpha: ' + event.alpha) // 0.00 (at the start)
}
但是这给了我当前的相对alpha值,而不是绝对值,即使event.absolute
解析为true
。
这意味着,它的行为与默认的deviceorientation
事件完全相同
你知道为什么这不符合预期吗