JavaScript
{dialog.object}getSize Method
Syntax
var screenInfo = {dialog.object}.getSize();
Returns
- screenInfoJSON
Returns a JSON object with the following properties:
- heightnumber
The screen height.
- widthnumber
The screen width.
- orientationstring
The screen's orientation. Will be 'landscape' or 'portrait'.
- isLandscapeboolean
Will be true if the screen is landscape and false if the screen is portrait.
Description
Gets information about the screen size and orientation.
Discussion
The getSize method returns the screen size and the device orientation.
Example
var s = {dialog.object}.getSize();
if (s.isLandscape) {
alert("Orientation is " + s.orientation);
} else {
alert("Orientation is landscape. Width is " + s.width + " and height is " + s.height);
}