Screen Information

In IE & NN version 4+ there are several options to detect screen information. Here are a few for you to use. They include screen size, display area, and amount of colors. Colors are reported in "bit" format(8bit=256 colors, 16bit=16k colors, 24=1.6m colors, 32=too many)

The screen width and height are important but even more valuable is the display area and document area. The display area values will report the size you have to put your page. If the document is in a frame(like this page) the document area will report the available size for the frame. Color depth can tell you if the client is going to see any of those fantastic pictures you have at your site.

This example is for a FRAMES based web page.
<script type="text/javascript"> <!-- var screenwidth = screen.width; var screenheight = screen.height; if (navigator.appName.indexOf("Micro") != -1) { windowwidth = top.document.body.clientWidth; windowheight =top.document.body.clientHeight; displaywidth = document.body.clientWidth; displayheight = document.body.clientHeight; colors = screen.colordepth; } else { windowwidth = top.document.width; windowheight = top.document.height; displaywidth = document.width; displayheight = document.height; colors = screen.pixelDepth; } var msg = "Screen is = "+screenwidth+"w x "+screenheight+"h\n"; msg+="Display area is = "+windowwidth+"w x "+windowheight+"h\n"; msg+="Document area is = "+displaywidth+"w x "+displayheight+"h\n"; msg+="Color Depth = " + colors + " bit\n"; alert(msg) // --> </script>

This example is for a NON FRAMES based web page.
Notice window sizes are gone? They are same as document in this case.
<script type="text/javascript"> <!-- var screenwidth = screen.width; var screenheight = screen.height; if (navigator.appName.indexOf("Micro") != -1) { displaywidth = document.body.clientWidth; displayheight = document.body.clientHeight; colors = screen.colordepth; } else { displaywidth = document.width; displayheight = document.height; colors = screen.pixelDepth; } var msg="Screen is = "+screenwidth+"w x "+screenheight+"h\n"; msg+="Document area is = "+displaywidth+"w x "+displayheight+"h\n"; msg+="Color Depth = " + colors + " bit\n"; alert(msg) // --> </script>



Anyway, I hope this helps those that want it.