Visit Mozilla.org

DOM:window.screen

From MDC

« Gecko DOM Reference

Contents

[edit] Summary

Returns a reference to the screen object associated with the window.

[edit] Syntax

screenObj = window.screen

[edit] Example

if (screen.pixelDepth < 8) {
  // use low-color version of page
} else { 
  // use regular, colorful page
}

[edit] Notes

The screen object is a special object for inspecting properties of the screen on which the current window is being rendered.

This object has the following properties:

availTop
Specifies the y-coordinate of the first pixel that is not allocated to permanent or semipermanent user interface features.
availLeft
Returns the first available pixel available from the left side of the screen.
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
Returns the amount of horizontal space in pixels available to the window.
colorDepth
Returns the color depth of the screen.
height
Returns the height of the screen in pixels.
left
Returns the distance in pixels from the left side of the main screen to the left side of the current screen.
pixelDepth
Gets the bit depth of the screen.
top
Returns the distance in pixels from the top side of the current screen.
width
Returns the width of the screen.

[edit] Specification

DOM Level 0. Not part of any standard.