js网页大小判断示例方法
复制代码代码如下所示:功能reachbottom(){
VaR scrollTop = 0;
var自己= 0;
无功scrollheight = 0;
如果(document.documentelement文档。文档元素}。scrollTop){
scrollTop = document.documentelement.scrolltop;
否则如果(文档体){ }
scrollTop = document.body.scrolltop;
}
如果(document.body.clientheight文档。文档元素}。自己){
自己=(document.body.clientheight <文档。文档元素}。自己document.body.clientheight:document.documentelement.clientheight);
{人}
自己=(document.body.clientheight >文档。文档元素}。自己document.body.clientheight:document.documentelement.clientheight);
}
scrollheight = math.max(document.body.scrollheight,文档。文档元素}。scrollheight);
如果(scrollTop +自己= = scrollheight){
返回true;
{人}
返回false;
}
}