Last updated 1 year ago
browser ⟩ DOM ⟩ type ⟩ Element ⟩ boxes ⟩ Element+boxes ⟩ .scrollBox
( .scrollWidth, .scrollHeight ) = .paddingBox + overflow
💾 Element+boxes
.paddingBox:.clientWidth/.clientHeight = content + padding
.scrollBox :.scrollWidth/.scrollHeight = content + padding + overflow
if no overflow, they are the same.
( .scrollWidth, .scrollHeight ) will round to integer.
use elem.getBoundingClientRect(), if fractional value is needed.
box models
element .paddingBox
document document size
viewport size.
CSS overflow
JS.info ⟩ Element size and scrolling ⟩ scrollWidth/scrollHeight
Element ⟩
.clientWidth, .clientHeight
.scrollLeft, .scrollTop, .scrollTo(), .scrollWidth, .scrollHeight
Window ⟩
.scrollX, .scrollY