initialOrientation Property

This property returns the initial orientation of the device

intel.xdk.device.initialOrientation

Description:

This property returns the current orientation of the device. It will return one of the following values:

Orientation Value
Portrait 0
Upside Down Portrait 180
Landscape Right 90
Landscape Left -90

Example:


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