{"name":"scrollTop","type":"method","title":".scrollTop()","deprecated":null,"removed":null,"desc":"Get the current vertical position of the scroll bar for the first element in the set of matched elements or set the vertical position of the scroll bar for every matched element.","categories":["css","offset","manipulation/style-properties","version/1.2.6"],"entries":[{"return":"Integer","signatures":{"added":"1.2.6"},"examples":{"desc":"Get the scrollTop of a paragraph.","code":"\nvar p = $( \"p:first\" );\n$( \"p:last\" ).text( \"scrollTop:\" + p.scrollTop() );\n","css":"\n p {\n margin: 10px;\n padding: 5px;\n border: 2px solid #666;\n }\n","html":"\n
Hello
\n"},"desc":"Get the current vertical position of the scroll bar for the first element in the set of matched elements or set the vertical position of the scroll bar for every matched element.","longdesc":"\nThe vertical scroll position is the same as the number of pixels that are hidden from view above the scrollable area. If the scroll bar is at the very top, or if the element is not scrollable, this number will be 0.
Hello
The vertical scroll position is the same as the number of pixels that are hidden from view above the scrollable area. Setting the scrollTop positions the vertical scroll of each matched element.