jQuery scrollLeft() Method
jQuery scrollLeft() Method
The scrollLeft() method is used to set or return the horizontal scrollbar position for the selected elements.
For your Information:-
- It is used to return the horizontal position of the scrollbar for the FIRST matched element.
- It is used to set the horizontal position of the scrollbar for ALL matched elements.
When the scrollbar is on the far left side, the position will be 0.
Syntax:-
Its syntax is:- $(selector).scrollLeft() OR $(selector).scrollLeft(position)
Further Explanation:-
Parameter | Description |
---|---|
position | Specifies the horizontal scrollbar position in pixels |