tags:

views:

39

answers:

2

This is frustrating me. It should be something really simple but I can't get it to work IE. I want to get the height of the current window. Not the scroll height, not the document height, the actual window height. I've tried window.innerHeight which returns undefined and document.documentElement.clientHeight which gives the scroll height.

A: 
pakore
nope, doesnt work, gives the scroll height
Yo Momma
+2  A: 

For IE, use

document.documentElement.offsetHeight;

So cross browser should be:

var height = "innerHeight" in window 
               ? window.innerHeight
               : document.documentElement.offsetHeight; 
Andy E
Andy, Flippen Ay man, it works, thanks
Yo Momma