orientation Property

This property returns the current orientation of the device

intel.xdk.device.orientation

Description:

This property returns the current orientation of the device. The value returned will be either 0, 90, -90, or 180.

Example:


//detect the current orientation of the device
if (intel.xdk.device.orientation == "90" || intel.xdk.device.orientation == "-90")
{
        //landscape
}
else
{
        //portrait
}
             
For more complete information about compiler optimizations, see our Optimization Notice.