.scrollTop()Returns: Number
Description: 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.
-
version added: 1.2.6.scrollTop()
- This method does not accept any arguments.
0
.
Example:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
|
Demo:
.scrollTop( value )Returns: jQuery
Description: Set the current vertical position of the scroll bar for each of the set of matched elements.
-
version added: 1.2.6.scrollTop( value )
-
valueType: NumberA number indicating the new position to set the scroll bar to.
-
scrollTop
positions the vertical scroll of each matched element.
Example:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
|