The screen Object


The screen Object

Another useful property of the window object is the screen property, which returns the screen objectwhich holds a great deal of information about the screen dimensions and color capabilities. You can see the various properties of the screen object in Table 7.3.

Table 7.3. The Properties of the screen Object

Property

NS2

NS3

NS4

NS6

IE3a

IE3b

IE4

IE5

IE5.5

IE6

availHeight , availWidth

   

x

x

   

x

x

x

x

 

Read-only

 

The available height and width of the screen (omitting items such as the Windows taskbar) in pixels.

availLeft , availTop

   

x

x

   

x

x

x

x

 

Read-only

 

The available left and top positions on the screen (omitting items such as the Windows taskbar if positioned along the left edge of the screen, and so on) in pixels.

bufferDepth

           

x

x

x

x

 

Read/write

 

If you set this property to -1 (the default is 0), the Internet Explorer will set its offscreen buffer to the same color depth as the screen.

colorDepth

   

x

x

   

x

x

x

x

 

Read-only

 

Holds the number of bits used to store a color in the screen. Same as pixelDepth .

fontSmoothingEnabled

           

x

x

x

x

 

Read/write

 

Set to true if font smoothing is enabled, false otherwise . The default is false.

height , width

   

x

x

   

x

x

x

x

 

Read-only

 

The height and width of the screen in pixels.

pixelDepth

   

x

x

   

x

x

x

x

 

Read/write

 

Holds the number of bits used to store a color in the screen. Same as colorDepth .

updateInterval

   

x

x

   

x

x

x

x

 

Read-only

 

Holds the number of milliseconds between screen updates.

Tip

The screen object is a great one if you want to determine whether you can display large graphics (for example, you can check the screen's height and width properties)and if not, you can load smaller graphics (by changing <IMG> elements' SRC property on-the-fly , for example, or even navigating to a new page with the location.href property).




Inside Javascript
Inside JavaScript
ISBN: 0735712859
EAN: 2147483647
Year: 2005
Pages: 492
Authors: Steve Holzner

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net