/    Sign up×
Community /Pin to ProfileBookmark

How do I get the height and width of the visible page?

window.innerHeight give the fix value of the height of the window.
same as document.height

How do I get the height and width of the visible page?

thanks
Nadav

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@mataichiJun 04.2009 — Its been my experience that this is very difficult to find a cross-browser way to do this.

Seems each one has its own way of reporting it. I'm sure it can be done, but it is more difficult than you would think (and should be).
Copy linkTweet thisAlerts:
@skywalker2208Jun 20.2009 — If you are still trying to figure it out give this a try.

[code=php]
var height_array = $$('body');
var height = height_array[0].getHeight();
[/code]
×

Success!

Help @nadavvin spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.4,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...