.scrollLeft()


Get the current horizontal position of the scroll bar for the first element in the set of matched elements or set the horizontal position of the scroll bar for every matched element.

.scrollLeft()Возвращает: Integer

Описание: Get the current horizontal position of the scroll bar for the first element in the set of matched elements.

  • Добавлен в версии: 1.2.6.scrollLeft()

    • This method does not accept any arguments.

The horizontal scroll position is the same as the number of pixels that are hidden from view to the left of the scrollable area. If the scroll bar is at the very left, or if the element is not scrollable, this number will be 0.

Note:.scrollLeft(), when called directly or animated as a property using .animate(), will not work if the element it is being applied to is hidden.

Примеры использования

.scrollLeft( value )Возвращает: jQuery

Описание: Set the current horizontal position of the scroll bar for each of the set of matched elements.

The horizontal scroll position is the same as the number of pixels that are hidden from view above the scrollable area. Setting the scrollLeft positions the horizontal scroll of each matched element.

Примеры использования