// forked from ksk1015's "ジャイロセンサーの値を取得" http://jsdo.it/ksk1015/904N var alpha = document.querySelector("#alpha"); var beta = document.querySelector("#beta"); var gamma = document.querySelector("#gamma"); var dice = document.querySelector("#dice"); window.addEventListener("deviceorientation", function(event){ alpha.textContent = event.alpha; beta.textContent = event.beta; gamma.textContent = event
![ジャイロセンサーで立体を回転 - jsdo.it - Share JavaScript, HTML5 and CSS](https://cdn-ak-scissors.b.st-hatena.com/image/square/5c377d111019e894010a505b0f4fbe203bdd6135/height=288;version=1;width=512/http%3A%2F%2Fjsdo-static-contents.s3.amazonaws.com%2Fimages%2Fcapture%2F1%2Ft%2FF%2F1tFo.jpg%3Ft%3D1370953055)