sud.onDeviceOrientationChange
JS
sud.onDeviceOrientationChange(function callback)Listen for the portrait/landscape switch event
Parameters
- function callback: Callback function for the portrait/landscape switch event
Parameters of the callback function
- Object res
| Property | Type | Description |
|---|---|---|
| value | string | Indicates whether the screen is landscape or portrait after switching |
Valid values of value:
| Value | Description |
|---|---|
| portrait | Portrait upright, with the HOME button at the bottom of the screen |
| landscape | Landscape upright, with the HOME button on the right side of the screen |
| landscapeReverse | Landscape reversed, with the HOME button on the left side of the screen |
| portraitReverse | Portrait reversed, with the HOME button at the top of the screen |
