复制代码 代码如下:
function reachbottom() {
var scrolltop = 0;
var clientheight = 0;
var scrollheight = 0;
if (document.documentelement && document.documentelement.scrolltop) {
scrolltop = document.documentelement.scrolltop;
} else if (document.body) {
scrolltop = document.body.scrolltop;
}
if (document.body.clientheight && document.documentelement.clientheight) {
clientheight = (document.body.clientheight } else {
clientheight = (document.body.clientheight > document.documentelement.clientheight) ? document.body.clientheight: document.documentelement.clientheight;
}
scrollheight = math.max(document.body.scrollheight, document.documentelement.scrollheight);
if (scrolltop + clientheight == scrollheight) {
return true;
} else {
return false;
}
}