window.onscroll = function () {
var scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
console.log("滚动距离" + scrollTop);
var windowHeight = document.documentElement.clientHeight || document.body.clientHeight;
console.log("可视高度" + windowHeight);
var scrollHeight = document.documentElement.scrollHeight || document.body.scrollHeight;
console.log("总高度" + scrollHeight);
if (scrollTop + windowHeight == scrollHeight) {
console.log("距顶部" + scrollTop + "可视区高度" + windowHeight + "滚动条总高度" + scrollHeight);
addData();
}
}