Click to See Complete Forum and Search --> : window width


Beach Bum
02-25-2003, 08:56 PM
if (document.layers) {
width = window.innerWidth;
}
else if (document.all) {
width = document.body.clientWidth;
}

That gives me the inner window width. What are the corresponding two variables to give me the outer window width?

pyro
02-25-2003, 09:02 PM
I don't know of anything that works to get the window size in IE (I'm assumbing that is what the problem is with)... Closest I've come is detecting the screen.width and praying they use a fullscreen browser window. :(

Beach Bum
02-25-2003, 09:16 PM
I have been using the inner width and adding 28 (based on my testing that works pretty well). I was just hoping someone knew of an outer width test so I could clean up my code a little.

pyro
02-25-2003, 09:30 PM
window.outerWidth :D

But, it doesn't work in IE, you will just have to keep adding to do that, methinks...

Beach Bum
02-26-2003, 01:43 PM
Actually, it is worse than that. In my above JS code, window.innerWidth does not work with NS7.