8

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?

deruse
  • 2,811
  • 7
  • 39
  • 59

3 Answers3

1

definitely start using jquery, accessing $(document).height() will do all the browser checks for you.

http://api.jquery.com/height/

sonjz
  • 4,602
  • 3
  • 40
  • 58
1

You can use jquery to do this without browser problem.

User jQuery $(document).height() and $(document).scrollTop() functions

FURKAN ILGIN
  • 2,273
  • 3
  • 17
  • 20
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
  • 79,093
  • 40
  • 195
  • 263