[Contents] [Previous] [Next] [Index]

screen

Contains properties describing the display screen and colors.

Client-side object

Implemented in

Navigator 4.0

Created by

The JavaScript runtime engine creates the screen object for you. You can access its properties automatically.

Description

This object contains read-only properties that allow you to get information about the user's display.

Property Summary

availHeight
Specifies the height of the screen, in pixels, minus permanent or semipermanent user interface features displayed by the operating system, such as the Taskbar on Windows.

availWidth
Specifies the width of the screen, in pixels, minus permanent or semipermanent user interface features displayed by the operating system, such as the Taskbar on Windows.

colorDepth
The bit depth of the color palette, if one is in use; otherwise, the value is derived from screen.pixelDepth.

height
Display screen height.

pixelDepth
Display screen color resolution (bits per pixel).

width
Display screen width.

Examples

The following function creates a string containing the current display properties:

function screen_properties() {
   document.examples.results.value = "("+screen.width+" x
      "+screen.height+") pixels, "+
      screen.pixelDepth +" bit depth, "+
      screen.colorDepth +" bit color palette depth.";
} // end function screen_properties

Properties

availHeight

Specifies the height of the screen, in pixels, minus permanent or semipermanent user interface features displayed by the operating system, such as the Taskbar on Windows.

Property of

screen

Implemented in

Navigator 4.0

availWidth

Specifies the width of the screen, in pixels, minus permanent or semipermanent user interface features displayed by the operating system, such as the Taskbar on Windows.

Property of

screen

Implemented in

Navigator 4.0

colorDepth

The bit depth of the color palette in bits per pixel, if a color palette is in use. Otherwise, this property is derived from screen.pixelDepth.

Property of

screen

Implemented in

Navigator 4.0

height

Display screen height, in pixels.

Property of

screen

Implemented in

Navigator 4.0

pixelDepth

Display screen color resolution, in bits per pixel.

Property of

screen

Implemented in

Navigator 4.0

width

Display screen width, in pixels.

Property of

screen

Implemented in

Navigator 4.0


[Contents] [Previous] [Next] [Index]

Last Updated: 10/31/97 12:31:44


Copyright © 1997 Netscape Communications Corporation