MDN self-hosted library · e01.org

Window: orientation property

The orientation read-only property of the Window interface returns the orientation in degrees (in 90-degree increments) of the viewport relative to the device's natural orientation.

no runnable cells web-api-instance-property upstream source

The orientation read-only property of the Window interface returns the orientation in degrees (in 90-degree increments) of the viewport relative to the device's natural orientation.

Its only possible values are -90, 0, 90, and 180. Positive values are counterclockwise; negative values are clockwise.

This property is deprecated. Use the Screen.orientation property instead, available on the window.screen property.

Specifications

Browser compatibility