Handling Orientation Changes in Your Canvas App
The orientation event enables you to handle changes in orientation when your canvas app appears on a mobile device. After your canvas app subscribes to the event, the event fires whenever the parent window fires a window.orientation event. The event returns a payload that contains these values.
| Value | Description |
|---|---|
clientHeight | The height of the app in pixels, specific to the device on which the canvas app renders |
clientWidth | The width of the canvas app in pixels, specific to the device on which the canvas app renders |
orientation | Contains one of these values.
|
The following code example shows how to subscribe to the orientation event.
The orientation event isn’t supported on Windows phones.
See Also