问题
I'm trying since 2 hours to find the entire document with AngularJS.
I found a lot of question about the height of the body, but nothing for the entire document.
With jQuery, I use $(document).height and the game is played but with angularjs I can have $window.height but if I'm trying $document.height, the function return "undefined".
I use AngularJS 1.2.4
回答1:
From http://james.padolsey.com/javascript/get-document-height-cross-browser/
function getDocHeight() {
return Math.max(
document.body.scrollHeight, document.documentElement.scrollHeight,
document.body.offsetHeight, document.documentElement.offsetHeight,
document.body.clientHeight, document.documentElement.clientHeight
);
}
来源:https://stackoverflow.com/questions/20500056/get-document-height-with-angularjs-1-2-4-not-the-body