Window Properties

Window Sizes

Alan Ennen and myself have been dismayed at the lack of javascript documentation, especially when it comes to little-known properties, some of which are mighty useful. When GeoCities implemented their "watermark" on their free pages, I was in awe of how the page knew where the lower right corner of the page was. I mean, absolute positioning using layers, DIVs or floating frames is ok... if you're working from the top left... but how about from the bottom-right?

There are properties of the window object which will identify, in pixels, the height and width of the window, as well as the height and width of the display area:

Javascript PropertyDescriptionCurrent Value
window.innerHeight height of the display area
window.innerWidth width of the display area
window.outerHeight height of the total browser window
window.outerWidth width of the entire browser window
window.screenX x-coordinate of the entire browser window
window.screenY y-coordinate of the entire browser window
window.alwaysRaised t/f property of floating window modality
window.alwaysLowered t/f property of floating window modality

Possible Applications