Skip to content

Commit 1868d0a

Browse files
authored
fix: 修复scrollHeight注释错误 (#266)
1 parent 35bbedb commit 1868d0a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/dom/element.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -371,8 +371,8 @@ document.body.scrollHeight
371371

372372
```javascript
373373
// HTML 代码如下
374-
// <div id="myDiv" style="height: 200px; overflow: hidden;">...<div>
375-
document.getElementById('myDiv').scrollHeight // 356
374+
// <div id="myDiv" style="height: 200px; overflow: hidden;">...</div>
375+
document.getElementById('myDiv').scrollHeight // 200
376376
```
377377

378378
上面代码中,即使`myDiv`元素的 CSS 高度只有200像素,且溢出部分不可见,但是`scrollHeight`仍然会返回该元素的原始高度。

0 commit comments

Comments
 (0)