Element.scrollLeftMax is a read-only instance property that returns the maximum left 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
scrollWidth - clientWidth
Fundamentals
Introduction
scrollLeft tells you where a box is scrolled horizontally. Sometimes you also need the maximum possible value—for example, to jump to the far right or to compute scroll progress.
Firefox exposes that maximum as scrollLeftMax. Because it is non-standard, this tutorial teaches both the Firefox property and the cross-browser formula you should prefer in real projects.
Element.scrollLeftMax 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 scrollWidth - clientWidth for portable code.
✓ Non-standard · Limited
Element.scrollLeftMax
Read-only maximum horizontal scroll offset — Firefox-oriented, not for production cross-browser use.
LimitedNon-standard
Mozilla FirefoxSupported (non-standard)
Yes
Google ChromeNot available — use scrollWidth - clientWidth
No
Microsoft EdgeNot available — use scrollWidth - clientWidth
No
Apple SafariNot available — use scrollWidth - clientWidth
No
OperaNot available — use scrollWidth - clientWidth
No
Internet ExplorerNot available
No
scrollLeftMaxLimited
Bottom line: Feature-detect if you inspect scrollLeftMax in Firefox. For shipping UI, use scrollWidth - clientWidth.
Wrap Up
Conclusion
scrollLeftMax is a convenient Firefox read-only helper for the maximum horizontal scroll offset, but it is non-standard. Learn it for understanding and interviews, then ship scrollWidth - clientWidth in real projects.
Non-standard Firefox helper for maximum horizontal scroll offset.
5
Core concepts
📄01
Get only
on Element
Kind
📝02
number
max offset
Type
🔍03
Non-standard
mainly Firefox
Status
✅04
Portable
W − C formula
Prefer
🎯05
Detect first
before reading
Tip
❓ Frequently Asked Questions
It is a read-only property that returns the maximum horizontal scroll offset possible for the element — the largest value scrollLeft can reach.
MDN marks Element.scrollLeftMax 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.scrollWidth - element.clientWidth. That works across modern browsers.
No. It is read-only. You read the maximum, then assign to scrollLeft if you want to move the scrollbar.
scrollLeft is the current horizontal scroll position and is writable. scrollLeftMax is the maximum possible position and is read-only (where supported).
Did you know?
Firefox also has a related non-standard property for the vertical axis: Element.scrollTopMax. The portable vertical alternative is scrollHeight - clientHeight.