A nice little trick appeared on the Mozilla hacks blog. Firefox 3.6 will be able to use your device orientation (if the information is available) and apply it to a web page. For now, I can’t really see any use for it, but hey, it is cool anyway.
Using the API is very simple. All you have to do is add a simple event listener:
-
window.addEventListener("MozOrientation", function(e) {
-
/* 3 values: e.x, e.y, e.z */
-
}, true);