user1658756
user1658756

Reputation: 1024

Browser Width and Height

I have the code to show the width and height for the viewport, but not the actual window size.

Any idea how I can get the window size?

Upvotes: 5

Views: 122

Answers (2)

Niet the Dark Absol
Niet the Dark Absol

Reputation: 324610

No, you cannot get the size of the browser panels.

The closest you can get is if the user has maximized the window, you can take the screen size and subtract the window size, and it will leave you with the size of the toolbars.

Upvotes: 1

Selvakumar Arumugam
Selvakumar Arumugam

Reputation: 79830

I am not sure, but I think what you want the document width and height

Try using $(document).height() and $(document).width() to get the page width and height.

DEMO: http://jsfiddle.net/JvGZr/2/

Upvotes: 0

Related Questions