I can not get the correct window height for IE7

I think I tried everything to get the correct window height in IE7, but all in vain.

Is there one surefire way to get the desired window height (viewport) in IE7 and other (better) browsers?

I tried:

window.innerHeight(), document.innerHeight() 

Jquery:

 $(window).height(), $('body').height(), $('body').css('height') 

Link

+4
source share
1 answer
 $(window).height(); 

Will return the correct viewport height in IE7 - this may be how you use it. If you try the following:

 alert($(window).height()); 

You will see its work (just tested IE7). If this simple bit of code does not work for you, make sure the jQuery library loads correctly and make sure you check the height inside the document.ready block.

+5
source

All Articles