Home >Web Front-end >JS Tutorial >Example of scrollLeft() method usage in jQuery_jquery
The example in this article describes the usage of the scrollLeft() method in jQuery. Share it with everyone for your reference. The specific analysis is as follows:
This method gets or sets the offset of the matching element relative to the left side of the scroll bar.
Grammar structure 1:
When the scrollLeft() method has no parameters, it gets the offset of the matching element relative to the left side of the scroll bar.
Example code:
Grammar structure 2:
When scrollLeft() takes parameters, it sets the offset of the matching element relative to the left side of the scroll bar.
Parameter list:
Example code:
I hope this article will be helpful to everyone’s jquery programming design.
This article is reproduced from: Ant Tribe http://www.softwhy.com/