Forum Moderators: open
I've tried window.height and window.width, but they don't seem to be defined for the window object.
Try the following page.
It's code generator that optionally centers windows
window.outerWidth
window.outerHeight
[mozilla.org...]
In IE, I'm not sure it's possible (correct me if..).
However, assuming that the chrome is even - left & right - the clientWidth will do for left centering (ed: Nah, what do I mean. It'll have to be a guess). Vertical centering may have a problem, unless you actually resize the window yourself.
The clientWidth/Height (corresp.to window.innerHeight in Moz) is a property of the body or documentElement depending on the mode. It's likely that you won't be able to test these properties until after page load.
Check out QuirksMode on the subject:
[quirksmode.org...]
and HowToCreate
[howtocreate.co.uk...]