开发者

javascript / jquery: how do I get the inner window height?

开发者 https://www.devze.com 2023-01-17 07:24 出处:网络
Like... the height that excludes the address bar, bookmarks, etc. just the viewing space. $(window).innerHeight()

Like... the height that excludes the address bar, bookmarks, etc. just the viewing space.

$(window).innerHeight()

a开发者_StackOverflowppears to not work.


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

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

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

As for why .innerHeight() isn't working:

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

0

精彩评论

暂无评论...
验证码 换一张
取 消