-
Notifications
You must be signed in to change notification settings - Fork 265
/
Copy pathscrollTop.xml
78 lines (78 loc) · 2.47 KB
/
scrollTop.xml
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?xml version="1.0"?>
<entries>
<entry type="method" name="scrollTop" return="Number">
<title>.scrollTop()</title>
<signature>
<added>1.2.6</added>
</signature>
<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.</desc>
<longdesc>
<p>The 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 <code>0</code>.</p>
</longdesc>
<example>
<desc>Get the scrollTop of a paragraph.</desc>
<code><![CDATA[
var p = $( "p" ).first();
$( "p" ).last().text( "scrollTop:" + p.scrollTop() );
]]></code>
<css><![CDATA[
p {
margin: 10px;
padding: 5px;
border: 2px solid #666;
}
]]></css>
<html><![CDATA[
<p>Hello</p><p></p>
]]></html>
</example>
<category slug="css"/>
<category slug="offset"/>
<category slug="manipulation/style-properties"/>
<category slug="version/1.2.6"/>
</entry>
<entry type="method" name="scrollTop" return="jQuery">
<signature>
<added>1.2.6</added>
<argument name="value" type="Number">
<desc>A number indicating the new position to set the scroll bar to.</desc>
</argument>
</signature>
<desc>Set the current vertical position of the scroll bar for each of the set of matched elements.</desc>
<longdesc>
<p>The vertical scroll position is the same as the number of pixels that are hidden from view above the scrollable area. Setting the <code>scrollTop</code> positions the vertical scroll of each matched element.</p>
</longdesc>
<example>
<desc>Set the scrollTop of a div.</desc>
<code><![CDATA[
$( "div.demo" ).scrollTop( 300 );
]]></code>
<css><![CDATA[
div.demo {
background: #ccc none repeat scroll 0 0;
border: 3px solid #666;
margin: 5px;
padding: 5px;
position: relative;
width: 200px;
height: 100px;
overflow: auto;
}
p {
margin: 10px;
padding: 5px;
border: 2px solid #666;
width: 1000px;
height: 1000px;
}
]]></css>
<html><![CDATA[
<div class="demo"><h1>lalala</h1><p>Hello</p></div>
]]></html>
</example>
<category slug="css"/>
<category slug="offset"/>
<category slug="manipulation/style-properties"/>
<category slug="version/1.2.6"/>
</entry>
</entries>