开发者

Way to determine the visible size of the web page

开发者 https://www.devze.com 2023-01-02 02:29 出处:网络
Is there a way for knowing what size was the visible portion of a page? Are there any services that provide this? I mean, not just screen resolution, but availab开发者_JAVA百科le browser area. When a

Is there a way for knowing what size was the visible portion of a page?

Are there any services that provide this? I mean, not just screen resolution, but availab开发者_JAVA百科le browser area. When a user has a lot of browser toolbars the area left for the webpage gets reduced. On the other hand, using Chrome may maximize the available space.

Thanks


Using Javascript, you can get the Window.InnerHeight & .InnerWidth


You'll have to use Javascript or JQuery to do so.

Here is a similar (answered) question


I found another implementation on StackOverflow itself which used jQuery.

$(window.top).width()  
$(window.top).height()

P.S. Just don't forget the brackets as i always missed them.

Reference: https://stackoverflow.com/a/7008807

0

精彩评论

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