The accelerometer interaction hooks into javascript via browser events.<p>Here's the basic usage for chrome: (for firefox the event is MozOrientation, and values are radians rather than degrees)<p><pre><code> window.addEventListener('deviceorientation', function(evt) {
var x = evt.gamma, y = evt.beta;
}, false);</code></pre>