Last updated 3 years ago
Was this helpful?
🔰 JS ⟩ browser ⟩ DOM ⟩ types ⟩ Window ⟩ scroll ⟩ smoothly
💾 replit: scroll smoothly
// heights of the document and viewport. const doc = { height: document.documentElement.offsetHeight }; const viewport = { height: window.innerHeight }; const scrollOffsetY = doc.height - viewport
JavaScript: The Definitive Guide (15.5 Document Geometry and Scrolling)