Forum Moderators: open
screen.availWidth, and screen.availHeight show you the size of the full display that is not consumed by permanent fixtures of the browser and operating system, such as menus or Task Bars. However, that still doesn't tell you the actual size of the window, which may not be filling the entire browser display area.
If you do want to find the size of the window itself:
In Netscape 4--
window.innerWidth and window.innerHeight will return the available space in the window.
The more recent standard is --
document.body.clientWidth and document.body.clientHeight.
However, the script accessing these properties cannot execute until AFTER the body is rendered. So you need to trigger that code by using the onLoad event handler in the body tag -- and that might mean serving up a refreshed page if elements need to be changed, based on the size of the window that the script returns.
When I go down this road at all, I usually use screen.availWidth and trust the user to know how to change their window to the size they need.