const scrollToTheEndFn = () => {
let scrollTopFn = 0; // 滚动条的高度
if (document.documentElement && document.documentElement.scrollTop) {
scrollTop = document.documentElement.scrollTop;
} else if (document.body) {
scrollTop = document.body.scrollTop;
}
let clientHeightFn = 0;
if (document.body.clientHeight && document.documentElement.clientHeight) {
clientHeight = Math.min(
document.body.clientHeight,
document.documentElement.clientHeight,
);
} else {
clientHeight = Math.max(
document.body.clientHeight,
document.documentElement.clientHeight,
);
}
const getScrollHeightFn = Math.max(
document.body.scrollHeight,
document.documentElement.scrollHeight,
);
if (scrollTop + clientHeight >= getScrollHeight ) {
//说明是到了底部了
}
};