https://developer.mozilla.org/zh-CN/search?q=scrollHeight
Height
返回当前文档中的<body>元素的高度
https://developer.mozilla.org/zh-CN/docs/Web/API/Document/height
scrollHeight
scrollHeight的值在有滚动条的情况下包括滚动出去的内容,没有滚动条时是和
clientHeight
相同
scrollHeight的值等于该元素在不使用滚动条的情况下为了适应视口中所用内容所需的最小高度。 没有垂直滚动条的情况下,scrollHeight值与元素视图填充所有内容所需要的最小值clientHeight
相同。包括元素的padding,但不包括元素的border和margin。scrollHeight也包括 ::before
和 ::after
这样的伪元素。
clientHeight、offsetHeight、scrollHeight、offsetTop、scrollTop、Height
原文:https://www.cnblogs.com/songsongblue/p/11663376.html