Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

Q285 How do I detect what screen resolution a browser is using?

irt.org | Knowledge Base | JavaScript | Screen | Q285 [ previous next ]

Q285 How do I detect what screen resolution a browser is using?

In Netscape Navigator 4 and Internet Explorer 4 there are new properties that give you better access to the screen/window dimensions.

Netscape Navigator 4:

  • 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.
  • screen.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.
  • screen.colorDepth - The bit depth of the color palette, if one is in use; otherwise, the value is derived from screen.pixelDepth.
  • screen.height - Display screen height.
  • screen.pixelDepth - Display screen color resolution (bits per pixel).
  • screen.width - Display screen width.
  • window.innerHeight - Specifies the vertical dimension, in pixels, of the window's content area.
  • window.innerWidth - Specifies the horizontal dimension, in pixels, of the window's content area.
  • window.outerHeight - Specifies the vertical dimension, in pixels, of the window's outside boundary.
  • window.outerWidth - Specifies the horizontal dimension, in pixels, of the window's outside boundary.
  • window.pageXOffset - Provides the current x-position, in pixels, of a window's viewed page.
  • window.pageYOffset - Provides the current y-position, in pixels, of a window's viewed page.

Microsoft Internet Explorer 4:

  • screen.bufferDepth - Specifies an offscreen bitmap buffer.
  • screen.colorDepth - Returns the bits-per-pixel value used for colors on the destination device or buffer.
  • screen.height - Returns the vertical resolution of the screen, in pixels.
  • screen.updateInterval - Sets or retrieves the update interval for the screen.
  • screen.width - Specifies the horizontal resolution of the screen, in pixels.

Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 30th March 2008. Maintained by: Martin Webb and Michel Plungjan
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.