Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

document.body.scrollHeight yielding two different results in firefox/chrome

Tags:

javascript

css

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?

like image 566
deruse Avatar asked Jan 13 '12 21:01

deruse


2 Answers

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

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

like image 137
sonjz Avatar answered Nov 15 '22 08:11

sonjz


You can use jquery to do this without browser problem.

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

like image 45
FURKAN ILGIN Avatar answered Nov 15 '22 09:11

FURKAN ILGIN