jQuery

jQuery Intro

jQuery Intro Quiz

jQuery Intro Exercise

jQuery Basic

jQuery Basic Quiz

jQuery Basic Exercise

jQuery Advance

jQuery Advance Quiz

jQuery Advance Exercise

jQuery Selectors

jQuery Effects

jQuery Events

jQuery Methods and Properties

jQuery Traversing

jQuery CSS and HTML Methods

jQuery scrollTop() Method

jQuery scrollTop() Method

 

 

The scrollTop() method is used to set or return the vertical scrollbar position for the selected elements.

 

For your Information:-

 

  • It is used to return the vertical position of the scrollbar for the FIRST matched element.
  • It is used to set the vertical position of the scrollbar for ALL matched elements.

 

When the scrollbar is on the Top, the position will be 0.

 

Syntax:-

 

Its syntax is:- $(selector).scrollTop() OR $(selector).scrollTop(position)

 

Further Explanation:-

 

Parameter Description
position Specifies the vertical scrollbar position in pixels

Code Explanation

All Tutorials related to jQuery CSS and HTML Methods

All Sections related to jQuery