Element.scrollLeftMax is a read-only number: the maximum left scroll offset possible for the element (MDN). Where supported, it is the largest value scrollLeft can normally reach.
Read the notes below before you get or set this property. Prefer feature detection when support is limited.
Syntax
Use el.scrollLeftMax. Start with this line.
JavaScript
element.scrollLeftMax
Call
What it does
element.scrollLeftMax
Primary signature.
Built into the browser. Read or assign el.scrollLeftMax — no import required.
Library declarations
JavaScript
element.scrollLeftMax
Parameters
Parameter
Description
Scroll container
Required. Element that can scroll horizontally
scrollWidth / clientWidth
Required. Standard way to compute the max
scrollLeftMax
Optional. Firefox helper — feature-detect only
Return Value
Return Value
Description
*
Number (max left scroll offset)
JavaScript Examples
Example 1 — Portable Max
Compute the maximum horizontal offset with standard properties.
Result. The box jumps near the right end of the content.
Note. You assign to scrollLeft, never to scrollLeftMax.
Compatibility
Browser Support
Element.scrollLeftMax is marked Non-standard on MDN and is not part of any specification. Support is limited (mainly Firefox). 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.
Frequently Asked Questions
Where supported, it returns a read-only number: the maximum left scroll offset possible for the element — the largest value scrollLeft can normally reach.
MDN marks Element.scrollLeftMax as Non-standard. It is not part of any specification. It is not labeled Deprecated or Experimental, but MDN does not recommend non-standard features for production.
Support is limited — mainly Firefox. Chrome, Safari, and Edge typically do not expose scrollLeftMax.
Prefer the portable calculation element.scrollWidth - element.clientWidth for the maximum horizontal scroll offset across browsers.
No. It is read-only. Read the maximum, then assign to scrollLeft if you want to move the scrollbar.
scrollLeft is the current horizontal offset and is writable. scrollLeftMax is the maximum possible offset and is read-only (where supported).