Screen Object

Screen Object

The Screen object contains information about the client display screen.

Note:There is no publicly available standard applied to the screen object, but all browsers support this object.

Screen object property

Property Description
availHeight Returns the height of the display screen (excluding the Windows taskbar).
availWidth Returns the width of the display screen (excluding the Windows taskbar).
bufferDepth Sets or returns the bit depth of the palette.
colorDepth Returns the bit depth of the palette on the target device or buffer.
deviceXDPI Returns the number of dots per inch horizontally on the display screen.
deviceYDPI Returns the number of dots per inch vertically on the display screen.
fontSmoothingEnabled Returns whether the user has enabled font smoothing in the display control panel.
height Returns the height of the display screen.
logicalXDPI Returns the number of standard dots per inch in the horizontal direction of the display screen.
logicalYDPI Returns the number of standard dots per inch in the vertical direction of the display screen.
pixelDepth Returns the color resolution (bits per pixel) of the display screen.
updateInterval Sets or returns the refresh rate of the screen.
width Returns the width of the display screen.

Screen Object Description

The screen property of each Window object refers to a Screen object. The Screen object contains information about the display browser screen. JavaScript programs will use this information to optimize their output to meet the display requirements of users. For example, a program can choose to use large images or small images based on the size of the display screen, and it can also choose to use 16-bit color or 8-bit color graphics based on the color depth of the display screen. In addition, JavaScript programs can also use information about the screen size to position new browser windows in the middle of the screen.