DekGenius.com
Team LiB   Previous Section   Next Section
Screen provides information about the display

Availability

JavaScript 1.2

Synopsis

screen

Properties

availHeight

Specifies the available height, in pixels, of the screen on which the web browser is displayed. On operating systems such as Windows, this available height does not include vertical space allocated to semipermanent features, such as the task bar at the bottom of the screen.

availLeft [Netscape 4]

Specifies the leftmost X-coordinate that is not allocated to a semipermanent display feature, such as an application shortcut bar or the Windows 95 task bar.

availTop [Netscape 4]

Specifies the topmost Y-coordinate that is not allocated to a semipermanent display feature, such as an application shortcut bar or the Windows 95 task bar.

availWidth

Specifies the available width, in pixels, of the screen on which the web browser is displayed. On operating systems such as Windows, this available width does not include horizontal space allocated to semipermanent features, such as application shortcut bars.

colorDepth

Specifies the base-2 logarithm of the number of colors allocated by the web browser and available for displaying images. For example, if a browser preallocates 128 colors, screen.colorDepth would be 7. On systems that do not allocate color palettes, this value is the same as the number of bits-per-pixel for the screen.

In IE 4, colorDepth specifies the color depth of the screen in bits-per-pixel, rather than the depth of a preallocated color palette. The screen.pixelDepth property provides this value in Netscape.

height

Specifies the total height, in pixels, of the screen on which the web browser is displayed. See also availHeight.

pixelDepth [Netscape 4]

Specifies the color depth, in bits-per-pixel, of the screen on which the web browser is displayed. Contrast with colorDepth.

width

Specifies the total width, in pixels, of the screen on which the web browser is displayed. See also availWidth.

Description

The screen property of every Window refers to a Screen object. The static properties of this global object contain information about the screen on which the browser is displayed. JavaScript programs can use this information to optimize their output to match the user's display capabilities. For example, a program can choose between large and small images based on the display size and between 16-bit color images and 8-bit color images based on the screen's color depth. A JavaScript program can also use the information about the size of the screen to center new browser windows on the screen.

See Also

The screen property of the Window object

    Team LiB   Previous Section   Next Section