Skip to content

Commit

Permalink
fix: 修复scrollHeight注释错误 (#266)
Browse files Browse the repository at this point in the history
  • Loading branch information
EnochGao authored Jan 5, 2024
1 parent 35bbedb commit 1868d0a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/dom/element.md
Original file line number Diff line number Diff line change
Expand Up @@ -371,8 +371,8 @@ document.body.scrollHeight

```javascript
// HTML 代码如下
// <div id="myDiv" style="height: 200px; overflow: hidden;">...<div>
document.getElementById('myDiv').scrollHeight // 356
// <div id="myDiv" style="height: 200px; overflow: hidden;">...</div>
document.getElementById('myDiv').scrollHeight // 200
```

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

0 comments on commit 1868d0a

Please sign in to comment.