Screen Properties: Introduction - Doc JavaScript | WebReference

Screen Properties: Introduction - Doc JavaScript

Screen Properties

DHTML is hot, and it's not cooling down in the near future. But in this column we'll discuss pure JavaScript features, without elements, positioning, visibility, or any other DHTML concepts. Navigator 4.0x and Internet Explorer 4.0x expanded existing objects, such as document, but they also introduced many new objects.

The screen object exposes variable properties associated with the client's screen. For example, you can determine the screen's dimensions and color depth. These properties are extremely useful for many purposes, which we'll discuss in the column. You'll learn:

  1. How to access the screen object without generating an error.
  2. How to determine the screen's dimensions, including the available portion of the screen.
  3. How to find out how many colors the user's system is capable of displaying.

Based on the maximum number of colors (the color bit depth), we'll show you how to optimize the graphics on any page, using a cross-browser, backward compatible script.

Created: April 7, 1998
Revised: April 7, 1998