获得文件的高度与angularjs 1.2.4(不是身体) [英] get document height with angularjs 1.2.4 (not the body)
本文介绍了获得文件的高度与angularjs 1.2.4(不是身体)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想,因为2个小时找到AngularJS整个文档。
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.
使用jQuery,我用的$(document).height和游戏的玩法但angularjs我可以有$ window.height,但如果我试图$ document.height,函数返回未定义。
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".
我用AngularJS 1.2.4
I use AngularJS 1.2.4
推荐答案
从的 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
);
}
这篇关于获得文件的高度与angularjs 1.2.4(不是身体)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文