Alright so innerHeight is one of those native JavaScript properties that is not fully supported in Internet Explorer (even IE8). I came across this when developing my own lightbox and first used window.innerheight which IE8 does not process this property correctly and an error will be thrown where you use it. As most developer do I use jQuery for most of my projects so why not let jQuery handle the browser problems (that is part of the reason it exists).

So we have to make sure to use the .height() function that we are targeting a jquery object because we want to use a jQuery function. So all that is necessary is to put window in our jQuery selector: $(window).height(); This will return the height of the browsers viewport. Respectively, the same explanation applies to width as well.

Note: this is not about the jQuery $.innerHeight() function but JavaScript’s native .innerHeight property.