Alex Rivera | Logout

height of page in javascript

Asked 2009-07-18T14:23:40.090
18

I'm unable to get the height of a page in javascript when the page is larger than the screen.

I thought this would get me the right height:

$(document).height();

but that only gets the height of the screen, same as:

$('body').height();

same as:

document.offsetHeight;

For some reason all these examples only return the height of the screen. Can somebody help?

Edit
Report

2 Answers

0

If you're cool with using jQuery, what about getting the body or html height? like:

var winHeight = $('body').height();
answered 2013-01-26T00:07:03.107
-1

Not sure about JQuery. But this link, might help you to understand various properties and how they behave in different modes in different browsers.

http://www.softcomplex.com/docs/get_window_size_and_scrollbar_position.html

answered 2009-07-18T14:32:41.917

Your Answer