haki
haki

Reputation: 9759

How to get the maximum available screen height in java script?

document/window outerHeight provides the size of the window (e.g when the browser windows is re-sized the value changes ).

screen.availHeight gives you the actual screen size (including the actual browser navigation etc)

I tried creating a fixed div set with top:0,buttom:0 and get the outerHeight but it's also restricted to the window's current size.

What is the best way to get the max available height when the window is maximized ?

Thanks.

EDIT

The answer, provided with the help of @Greg Burghardt is

screen.availHeight - (window.outerHeight - window.innerHeight)

Upvotes: 1

Views: 367

Answers (1)

Greg Burghardt
Greg Burghardt

Reputation: 18783

You may be looking for:

document.documentElement.offset[Height|Width]

A good reference: A Tale of Two Viewports

Upvotes: 2

Related Questions