I am trying to get access to the height of the entire page (including scrolling). In chrome, document.body.scrollHeight does this. In firefox, this doesn't work... what is the equivalent in firefox?
Asked
Active
Viewed 1.6k times
8
-
1With a scrollbar, it doesnt. jQuery takes care of it thought. – deruse Jan 13 '12 at 21:25
-
did you find a solution for FF ? – Eugene Gluhotorenko Jun 25 '12 at 10:32
3 Answers
1
definitely start using jquery, accessing $(document).height() will do all the browser checks for you.

sonjz
- 4,870
- 3
- 42
- 60
1
You can use jquery to do this without browser problem.
User jQuery $(document).height()
and $(document).scrollTop()
functions

FURKAN ILGIN
- 2,290
- 3
- 18
- 21
1
<script type="text/javascript">
var scnWid,scnHei;
if (self.innerHeight) // all except Explorer
{
scnWid = self.innerWidth;
scnHei = self.innerHeight;
}
else if (document.documentElement && document.documentElement.clientHeight)
// Explorer 6 Strict Mode
{
scnWid = document.documentElement.clientWidth;
scnHei = document.documentElement.clientHeight;
}
else if (document.body) // other Explorers
{
scnWid = document.body.clientWidth;
scnHei = document.body.clientHeight;
}
</script>

Travis J
- 81,153
- 41
- 202
- 273