scrollheight


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<!DOCTYPE html>
<html>

<head>
<meta charset="UTF-8">
<title></title>
<style>

height: 1500px;
width: 500px;
background: #a5c300;
}
</style>
</head>

<body>
<div id="box">
</div>
<script>
var bd = document.body
var box = document.getElementById('box')

console.log(bd.scrollHeight) // 1500不变
console.log(box.scrollHeight) //1500不变
</script>
</body>

</html>