The source code for this sample can be found here: https://github.com/gomobile/sample-simpleaccelerometor or download the Intel® XDK to check out all the HTML5 Samples.
This function handles the events thrown by the device relaying accelerometer information back to the HTML5. This function uses a simple CSS3 transformation to rotate the arrow image to align it with the current accelerometer reading.
Use the Accelerometer portion of the XDK to test this sample application in the simulator.
On an iOS device, the operating system will flip any application if the device is held upside down. While this could be helpful for any user who might not know how to hold their device properly, it can be frustrating for an accelerometer demo app such as this one.