Element.scrollTopMax is a read-only instance property that returns the maximum top scroll offset possible for an element. Learn what it means, why it is non-standard, how to feature-detect it, and how to replace it with a portable calculation—with five examples and try-it labs.
01
Kind
Instance property
02
Access
Read-only
03
Type
Number (pixels)
04
Status
Non-standard
05
Support
Mainly Firefox
06
Portable alt
scrollHeight - clientHeight
Fundamentals
Introduction
scrollTop tells you where a box is scrolled vertically. Sometimes you also need the maximum possible value—for example, to jump to the bottom or to compute scroll progress.
Firefox exposes that maximum as scrollTopMax. Because it is non-standard, this tutorial teaches both the Firefox property and the cross-browser formula you should prefer in real projects.
Element.scrollTopMax is marked Non-standard on MDN and is not part of any specification. Support is limited (mainly Firefox). Logos use the shared browser-image-sprite.png sprite from this project. Prefer scrollHeight - clientHeight for portable code.
✓ Non-standard · Limited
Element.scrollTopMax
Read-only maximum vertical scroll offset — Firefox-oriented, not for production cross-browser use.
LimitedNon-standard
Mozilla FirefoxSupported (non-standard)
Yes
Google ChromeNot available — use scrollHeight - clientHeight
No
Microsoft EdgeNot available — use scrollHeight - clientHeight
No
Apple SafariNot available — use scrollHeight - clientHeight
No
OperaNot available — use scrollHeight - clientHeight
No
Internet ExplorerNot available
No
scrollTopMaxLimited
Bottom line: Feature-detect if you inspect scrollTopMax in Firefox. For shipping UI, use scrollHeight - clientHeight.
Wrap Up
Conclusion
scrollTopMax is a convenient Firefox read-only helper for the maximum vertical scroll offset, but it is non-standard. Learn it for understanding and interviews, then ship scrollHeight - clientHeight in real projects.
Non-standard Firefox helper for maximum vertical scroll offset.
5
Core concepts
📄01
Get only
on Element
Kind
📝02
number
max offset
Type
🔍03
Non-standard
mainly Firefox
Status
✅04
Portable
H − C formula
Prefer
🎯05
Detect first
before reading
Tip
❓ Frequently Asked Questions
It is a read-only property that returns the maximum vertical scroll offset possible for the element — the largest value scrollTop can reach.
MDN marks Element.scrollTopMax as Non-standard. It is not part of any specification. It is not labeled Deprecated or Experimental on that MDN page, but it should not be used as a production cross-browser API.
Support is limited. It is mainly available in Firefox. Chrome, Safari, and Edge typically do not provide this property.
Prefer the portable calculation: element.scrollHeight - element.clientHeight. That works across modern browsers.
No. It is read-only. You read the maximum, then assign to scrollTop if you want to move the scrollbar.
scrollTop is the current vertical scroll position and is writable. scrollTopMax is the maximum possible position and is read-only (where supported).
Did you know?
Firefox also has a related non-standard property for the horizontal axis: Element.scrollLeftMax. The portable horizontal alternative is scrollWidth - clientWidth.