在我的脚本中,document.body.scrollHeight的值与document.body.offsetHeight相同。为什么会这样?
window.addEventListener("scroll", function(){
let leftout = 100;
if(leftout > (document.body.scrollHeight - document.body.scrollTop -
document.body.offsetHeight)){
console.log("leftout = " + (document.body.scrollHeight -
document.body.scrollTop - document.body.offsetHeight));
}
});