Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

window.innerHeight ie8 alternative

I have some calculations that rely on window.innerHeight. But as I have found out this is not available in any IE before IE9. All the other options I have looked at don't even come close to the figure I get when I use window.innerHeight.

Does anybody have a work around?

like image 352
Theo Kouzelis Avatar asked Apr 16 '12 11:04

Theo Kouzelis


People also ask

How do you make a window innerHeight?

The read-only innerHeight property of the Window interface returns the interior height of the window in pixels, including the height of the horizontal scroll bar, if present. The value of innerHeight is taken from the height of the window's layout viewport. The width can be obtained using the innerWidth property.

What is window innerHeight and outerHeight?

innerWidth / innerHeight - includes padding but not border. outerWidth / outerHeight - includes padding, border, and optionally margin. height / width - element height (no padding, no margin, no border)

Can I use window innerWidth?

The innerWidth property is available on any window or object that behaves like a window, such as a frame or tab.


1 Answers

You might want to try:

document.documentElement.clientHeight; 

Or can use jQuery's .height() method:

$(window).height(); 
like image 75
Sandeep Pathak Avatar answered Sep 22 '22 12:09

Sandeep Pathak