How to get scrollHeight value from document?
Getting undefined currently.
Anyone? :)
How to get scrollHeight value from document?
Getting undefined currently.
Anyone? :)
$(document).height() //returns window height
$(document).scrollTop() //returns scroll position from top of document
Something like this should solve your problem:
$.getDocHeight = function(){
var D = document;
return Math.max(Math.max(D.body.scrollHeight, D.documentElement.scrollHeight), Math.max(D.body.offsetHeight, D.documentElement.offsetHeight), Math.max(D.body.clientHeight, D.documentElement.clientHeight));
};
alert( $.getDocHeight() );
Ps: Call that function every time you need it, the alert is for testing purposes..