You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: entries/fadeIn.xml
+77-45
Original file line number
Diff line number
Diff line change
@@ -22,16 +22,18 @@
22
22
<p>The <code>.fadeIn()</code> method animates the opacity of the matched elements. It is similar to the <code><ahref="/fadeTo/">.fadeTo()</a></code> method but that method does not unhide the element and can specify the final opacity level.</p>
23
23
<p>Durations are given in milliseconds; higher values indicate slower animations, not faster ones. The strings <code>'fast'</code> and <code>'slow'</code> can be supplied to indicate durations of <code>200</code> and <code>600</code> milliseconds, respectively. If any other string is supplied, or if the <code>duration</code> parameter is omitted, the default duration of <code>400</code> milliseconds is used.</p>
24
24
<p>We can animate any element, such as a simple image:</p>
With the element initially hidden, we can show it slowly:
31
+
$( "#clickme" ).click(function() {
32
+
$( "#book" ).fadeIn( "slow", function() {
33
+
// Animation complete
34
+
});
35
+
});
36
+
</code></pre>
35
37
<pclass="image four-across">
36
38
<imgsrc="/resources/0042_06_33.png"alt=""/>
37
39
<imgsrc="/resources/0042_06_34.png"alt=""/>
@@ -42,59 +44,89 @@
42
44
<p><strong>As of jQuery 1.4.3</strong>, an optional string naming an easing function may be used. Easing functions specify the speed at which the animation progresses at different points within the animation. The only easing implementations in the jQuery library are the default, called <code>swing</code>, and one that progresses at a constant pace, called <code>linear</code>. More easing functions are available with the use of plug-ins, most notably the <ahref="http://jqueryui.com">jQuery UI suite</a>.</p>
43
45
<h4id="callback-function">Callback Function</h4>
44
46
<p>If supplied, the callback is fired once the animation is complete. This can be useful for stringing different animations together in sequence. The callback is not sent any arguments, but <code>this</code> is set to the DOM element being animated. If multiple elements are animated, it is important to note that the callback is executed once per matched element, not once for the animation as a whole. </p>
45
-
<p><strong>As of jQuery 1.6</strong>, the <code><ahref="http://api.jquery.com/promise/">.promise()</a></code> method can be used in conjunction with the <code><ahref="http://api.jquery.com/deferred.done/">deferred.done()</a></code> method to execute a single callback for the animation as a whole when <em>all</em> matching elements have completed their animations ( See the <ahref="http://api.jquery.com/promise/#example-1">example for .promise()</a> ). </p>
47
+
<p><strong>As of jQuery 1.6</strong>, the <code><ahref="/promise/">.promise()</a></code> method can be used in conjunction with the <code><ahref="/deferred.done/">deferred.done()</a></code> method to execute a single callback for the animation as a whole when <em>all</em> matching elements have completed their animations ( See the <ahref="/promise/#example-1">example for .promise()</a> ). </p>
Copy file name to clipboardExpand all lines: entries/fadeOut.xml
+72-50
Original file line number
Diff line number
Diff line change
@@ -22,101 +22,123 @@
22
22
<p>The <code>.fadeOut()</code> method animates the opacity of the matched elements. Once the opacity reaches 0, the <code>display</code> style property is set to <code>none</code>, so the element no longer affects the layout of the page.</p>
23
23
<p>Durations are given in milliseconds; higher values indicate slower animations, not faster ones. The strings <code>'fast'</code> and <code>'slow'</code> can be supplied to indicate durations of <code>200</code> and <code>600</code> milliseconds, respectively. If any other string is supplied, or if the <code>duration</code> parameter is omitted, the default duration of <code>400</code> milliseconds is used.</p>
24
24
<p>We can animate any element, such as a simple image:</p>
<p>With the element initially shown, we can hide it slowly:</p>
30
-
<pre><code>$('#clickme').click(function() {
31
-
$('#book').fadeOut('slow', function() {
32
+
<pre><code>
33
+
$( "#clickme" ).click(function() {
34
+
$( "#book" ).fadeOut( "slow", function() {
32
35
// Animation complete.
33
36
});
34
-
});</code></pre>
37
+
});
38
+
</code></pre>
35
39
<pclass="image four-across">
36
40
<imgsrc="/resources/0042_06_37.png"alt=""/>
37
41
<imgsrc="/resources/0042_06_38.png"alt=""/>
38
42
<imgsrc="/resources/0042_06_39.png"alt=""/>
39
43
<imgsrc="/resources/0042_06_40.png"alt=""/>
40
44
</p>
41
45
<divclass="warning">
42
-
<p><strong>Note: </strong>To avoid unnecessary DOM manipulation, <code>.fadeOut()</code> will not hide an element that is already considered hidden. For information on which elements jQuery considers hidden, see <ahref="http://api.jquery.com/hidden-selector"> :hidden Selector</a>.</p>
46
+
<p><strong>Note: </strong>To avoid unnecessary DOM manipulation, <code>.fadeOut()</code> will not hide an element that is already considered hidden. For information on which elements jQuery considers hidden, see <ahref="/hidden-selector/"> :hidden Selector</a>.</p>
43
47
</div>
44
48
<h4id="easing">Easing</h4>
45
49
<p><strong>As of jQuery 1.4.3</strong>, an optional string naming an easing function may be used. Easing functions specify the speed at which the animation progresses at different points within the animation. The only easing implementations in the jQuery library are the default, called <code>swing</code>, and one that progresses at a constant pace, called <code>linear</code>. More easing functions are available with the use of plug-ins, most notably the <ahref="http://jqueryui.com">jQuery UI suite</a>.</p>
46
50
<h4id="callback-function">Callback Function</h4>
47
51
<p>If supplied, the callback is fired once the animation is complete. This can be useful for stringing different animations together in sequence. The callback is not sent any arguments, but <code>this</code> is set to the DOM element being animated. If multiple elements are animated, it is important to note that the callback is executed once per matched element, not once for the animation as a whole.</p>
48
-
<p><strong>As of jQuery 1.6</strong>, the <code><ahref="http://api.jquery.com/promise/">.promise()</a></code> method can be used in conjunction with the <code><ahref="http://api.jquery.com/deferred.done/">deferred.done()</a></code> method to execute a single callback for the animation as a whole when <em>all</em> matching elements have completed their animations ( See the <ahref="http://api.jquery.com/promise/#example-1">example for .promise()</a> ). </p>
52
+
<p><strong>As of jQuery 1.6</strong>, the <code><ahref="/promise/">.promise()</a></code> method can be used in conjunction with the <code><ahref="/deferred.done/">deferred.done()</a></code> method to execute a single callback for the animation as a whole when <em>all</em> matching elements have completed their animations ( See the <ahref="/promise/#example-1">example for .promise()</a> ). </p>
0 commit comments