<style>*{margin:0;padding:0}body{height: 2000px;}div{width:300px;height: 1700px;background-color: red;}</style><div></div><script>var bodyH = document.body.clientHeight;var vh = document.documentElement.clientHeight;// console.log(bodyH)console.log(vh)/* 滚动条滚动的距离+vh ==bodyH */window.onscroll= function(){var scrollTop = window.scrollY;console.log(scrollTop)}/* scrollTop+vh ==bodyH 判断页面到底了*/</script>
