Javascript / jquery: how to get the inner height of a window?

Like ... a height that excludes an address bar, bookmarks, etc. view space only.

$(window).innerHeight() 

doesn't seem to work.

+6
javascript jquery
source share
1 answer

Use .height() for this, as indicated in the API:

This method is also able to find the height of the window and the document.

 $(window).height(); // returns height of browser viewport $(document).height(); // returns height of HTML document 

As for why .innerHeight() doesn't work:

This method is not applicable to window and document objects; use .height() for this.

+14
source share

All Articles