需要的时候就直接调用就行,实时获取当前的Tilt、Rotation Rate、Gravity、Acceleration。
Practical Application and Usage of the W3C Device Orientation API