Print this Section

  
  

The screen Object

The screen object is considered part of window object and provides information about the user's screen. The screen object properties can be used with the window objects methods to set the size and position of the browser window. The general format of the window.screen object or simply screen is shown below:


screen.property

Figure 7-24. General format to reference properties of the screen object.

For each of the following properties, its value is shown for the browser you are using to view this page.


document.getElementById("output").innerHTML = screen.property;
Property Description and Current Setting
width The total width of the user's screen in pixels:
height The total height of the user's screen in pixels:
availWidth The available width of the user's screen in pixels:
availHeight The available height of the user's screen in pixels:
colorDepth The bit depth of the color palette for displaying images:


TOP | NEXT: The history Object