Skip to content

Commit 982d73d

Browse files
committed
Update effects methods with options object
* use <options> and <option> nodes * add .method(options) signature for all shorthand effects
1 parent 5465eed commit 982d73d

10 files changed

+471
-15
lines changed

entries/animate.xml

+46-13
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,60 @@
77
<argument name="properties" type="PlainObject">
88
<desc>A map of CSS properties that the animation will move toward.</desc>
99
</argument>
10-
<argument name="duration" type="String,Number" optional="true">
11-
<desc>A string or number determining how long the animation will run.</desc>
12-
</argument>
13-
<argument name="easing" type="String" optional="true">
14-
<desc>A string indicating which easing function to use for the transition.</desc>
15-
</argument>
16-
<argument name="complete" type="Function" optional="true">
17-
<desc>A function to call once the animation is complete.</desc>
18-
</argument>
10+
<argument name="duration" type="Option"/>
11+
<argument name="easing" type="Option"/>
12+
<argument name="complete" type="Option"/>
1913
</signature>
2014
<signature>
2115
<added>1.0</added>
2216
<argument name="properties" type="PlainObject">
2317
<desc>A map of CSS properties that the animation will move toward.</desc>
2418
</argument>
25-
<argument name="options" type="PlainObject">
26-
<desc>A map of additional options to pass to the method. Supported keys:
27-
<ul><li><code>duration</code>: A string or number determining how long the animation will run.</li><li><code>easing</code>: A string indicating which easing function to use for the transition.</li><li><code>complete</code>: A function to call once the animation is complete.</li><li><code>step</code>: A function to be called after each step of the animation.</li><li><code>queue</code>: A Boolean indicating whether to place the animation in the effects queue. If <code>false</code>, the animation will begin immediately. <strong>As of jQuery 1.7</strong>, the <code>queue</code> option can also accept a string, in which case the animation is added to the queue represented by that string.</li><li><code>specialEasing</code>: A map of one or more of the CSS properties defined by the properties argument and their corresponding easing functions (added 1.4).</li></ul>
28-
</desc>
19+
<argument name="options" type="Options">
20+
<desc>A map of additional options to pass to the method.</desc>
2921
</argument>
3022
</signature>
23+
24+
<options>
25+
<option name="duration" type="Number|String" default="400">
26+
<desc>A string or number determining how long the animation will run.</desc>
27+
</option>
28+
<option name="easing" type="String" default="swing">
29+
<desc>A string indicating which easing function to use for the transition.</desc>
30+
</option>
31+
<option name="complete" type="Function">
32+
<desc>A function to call once the animation is complete.</desc>
33+
<!-- no parameters -->
34+
</option>
35+
<option name="step" type="Function">
36+
<desc>A function to be called after each step of the animation.</desc>
37+
<parameter name="now" type="Number">
38+
<desc>The numeric value of the property being animated at each step</desc>
39+
</parameter>
40+
<parameter name="fx" type="PlainObject">
41+
<desc>A map of properties related to the animation and the element being animated</desc>
42+
<property name="elem" type="DOM">
43+
<desc>The animated element</desc>
44+
</property>
45+
<property name="start" type="Number">
46+
<desc>The first value of the animated property</desc>
47+
</property>
48+
<property name="end" type="Number">
49+
<desc>The last value of the animated property</desc>
50+
</property>
51+
<property name="prop" type="String">
52+
<desc>The property being animated</desc>
53+
</property>
54+
</parameter>
55+
</option>
56+
<option name="queue" type="Boolean" default="true">
57+
<desc>A Boolean indicating whether to place the animation in the effects queue. If false, the animation will begin immediately. <strong>As of jQuery 1.7</strong>, the queue option can also accept a string, in which case the animation is added to the queue represented by that string.</desc>
58+
</option>
59+
<option name="specialEasing" type="PlainObject">
60+
<desc>A map of one or more of the CSS properties defined by the properties argument and their corresponding easing functions (added 1.4).</desc>
61+
</option>
62+
</options>
63+
3164
<longdesc>
3265
<p>The <code>.animate()</code> method allows us to create animation effects on any numeric CSS property. The only required parameter is a map of CSS properties. This map is similar to the one that can be sent to the <code>.css()</code> method, except that the range of properties is more restrictive.</p>
3366
<h4 id="animation-properties">Animation Properties and Values</h4>

entries/fadeIn.xml

+47
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@
1111
<desc>A function to call once the animation is complete.</desc>
1212
</argument>
1313
</signature>
14+
<signature>
15+
<added>1.0</added>
16+
<argument name="options" type="Options">
17+
<desc>A map of additional options to pass to the method.</desc>
18+
</argument>
19+
</signature>
1420
<signature>
1521
<added>1.4.3</added>
1622
<argument name="duration" type="String,Number" optional="true">
@@ -23,6 +29,47 @@
2329
<desc>A function to call once the animation is complete.</desc>
2430
</argument>
2531
</signature>
32+
33+
<options>
34+
<option name="duration" type="Number|String" default="400">
35+
<desc>A string or number determining how long the animation will run.</desc>
36+
</option>
37+
<option name="easing" type="String" default="swing">
38+
<desc>A string indicating which easing function to use for the transition.</desc>
39+
</option>
40+
<option name="complete" type="Function">
41+
<desc>A function to call once the animation is complete.</desc>
42+
<!-- no parameters -->
43+
</option>
44+
<option name="step" type="Function">
45+
<desc>A function to be called after each step of the animation.</desc>
46+
<parameter name="now" type="Number">
47+
<desc>The numeric value of the property being animated at each step</desc>
48+
</parameter>
49+
<parameter name="fx" type="PlainObject">
50+
<desc>A map of properties related to the animation and the element being animated</desc>
51+
<property name="elem" type="DOM">
52+
<desc>The animated element</desc>
53+
</property>
54+
<property name="start" type="Number">
55+
<desc>The first value of the animated property</desc>
56+
</property>
57+
<property name="end" type="Number">
58+
<desc>The last value of the animated property</desc>
59+
</property>
60+
<property name="prop" type="String">
61+
<desc>The property being animated</desc>
62+
</property>
63+
</parameter>
64+
</option>
65+
<option name="queue" type="Boolean" default="true">
66+
<desc>A Boolean indicating whether to place the animation in the effects queue. If false, the animation will begin immediately. <strong>As of jQuery 1.7</strong>, the queue option can also accept a string, in which case the animation is added to the queue represented by that string.</desc>
67+
</option>
68+
<option name="specialEasing" type="PlainObject">
69+
<desc>A map of one or more of the CSS properties defined by the properties argument and their corresponding easing functions (added 1.4).</desc>
70+
</option>
71+
</options>
72+
2673
<longdesc>
2774
<p>The <code>.fadeIn()</code> method animates the opacity of the matched elements.</p>
2875
<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>

entries/fadeOut.xml

+47
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@
1111
<desc>A function to call once the animation is complete.</desc>
1212
</argument>
1313
</signature>
14+
<signature>
15+
<added>1.0</added>
16+
<argument name="options" type="Options">
17+
<desc>A map of additional options to pass to the method.</desc>
18+
</argument>
19+
</signature>
1420
<signature>
1521
<added>1.4.3</added>
1622
<argument name="duration" type="String,Number" optional="true">
@@ -23,6 +29,47 @@
2329
<desc>A function to call once the animation is complete.</desc>
2430
</argument>
2531
</signature>
32+
33+
<options>
34+
<option name="duration" type="Number|String" default="400">
35+
<desc>A string or number determining how long the animation will run.</desc>
36+
</option>
37+
<option name="easing" type="String" default="swing">
38+
<desc>A string indicating which easing function to use for the transition.</desc>
39+
</option>
40+
<option name="complete" type="Function">
41+
<desc>A function to call once the animation is complete.</desc>
42+
<!-- no parameters -->
43+
</option>
44+
<option name="step" type="Function">
45+
<desc>A function to be called after each step of the animation.</desc>
46+
<parameter name="now" type="Number">
47+
<desc>The numeric value of the property being animated at each step</desc>
48+
</parameter>
49+
<parameter name="fx" type="PlainObject">
50+
<desc>A map of properties related to the animation and the element being animated</desc>
51+
<property name="elem" type="DOM">
52+
<desc>The animated element</desc>
53+
</property>
54+
<property name="start" type="Number">
55+
<desc>The first value of the animated property</desc>
56+
</property>
57+
<property name="end" type="Number">
58+
<desc>The last value of the animated property</desc>
59+
</property>
60+
<property name="prop" type="String">
61+
<desc>The property being animated</desc>
62+
</property>
63+
</parameter>
64+
</option>
65+
<option name="queue" type="Boolean" default="true">
66+
<desc>A Boolean indicating whether to place the animation in the effects queue. If false, the animation will begin immediately. <strong>As of jQuery 1.7</strong>, the queue option can also accept a string, in which case the animation is added to the queue represented by that string.</desc>
67+
</option>
68+
<option name="specialEasing" type="PlainObject">
69+
<desc>A map of one or more of the CSS properties defined by the properties argument and their corresponding easing functions (added 1.4).</desc>
70+
</option>
71+
</options>
72+
2673
<longdesc>
2774
<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>
2875
<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>

entries/fadeToggle.xml

+47
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,53 @@
1414
<desc>A function to call once the animation is complete.</desc>
1515
</argument>
1616
</signature>
17+
<signature>
18+
<added>1.4.4</added>
19+
<argument name="options" type="Options">
20+
<desc>A map of additional options to pass to the method.</desc>
21+
</argument>
22+
</signature>
23+
24+
<options>
25+
<option name="duration" type="Number|String" default="400">
26+
<desc>A string or number determining how long the animation will run.</desc>
27+
</option>
28+
<option name="easing" type="String" default="swing">
29+
<desc>A string indicating which easing function to use for the transition.</desc>
30+
</option>
31+
<option name="complete" type="Function">
32+
<desc>A function to call once the animation is complete.</desc>
33+
<!-- no parameters -->
34+
</option>
35+
<option name="step" type="Function">
36+
<desc>A function to be called after each step of the animation.</desc>
37+
<parameter name="now" type="Number">
38+
<desc>The numeric value of the property being animated at each step</desc>
39+
</parameter>
40+
<parameter name="fx" type="PlainObject">
41+
<desc>A map of properties related to the animation and the element being animated</desc>
42+
<property name="elem" type="DOM">
43+
<desc>The animated element</desc>
44+
</property>
45+
<property name="start" type="Number">
46+
<desc>The first value of the animated property</desc>
47+
</property>
48+
<property name="end" type="Number">
49+
<desc>The last value of the animated property</desc>
50+
</property>
51+
<property name="prop" type="String">
52+
<desc>The property being animated</desc>
53+
</property>
54+
</parameter>
55+
</option>
56+
<option name="queue" type="Boolean" default="true">
57+
<desc>A Boolean indicating whether to place the animation in the effects queue. If false, the animation will begin immediately. <strong>As of jQuery 1.7</strong>, the queue option can also accept a string, in which case the animation is added to the queue represented by that string.</desc>
58+
</option>
59+
<option name="specialEasing" type="PlainObject">
60+
<desc>A map of one or more of the CSS properties defined by the properties argument and their corresponding easing functions (added 1.4).</desc>
61+
</option>
62+
</options>
63+
1764
<longdesc>
1865
<p>The <code>.fadeToggle()</code> method animates the opacity of the matched elements. When called on a visible element, the element's <code>display</code> style property is set to <code>none</code> once the opacity reaches 0, so the element no longer affects the layout of the page.</p>
1966
<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.</p>

entries/hide.xml

+48-1
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,15 @@
1414
<desc>A function to call once the animation is complete.</desc>
1515
</argument>
1616
</signature>
17+
<signature>
18+
<added>1.0</added>
19+
<argument name="options" type="Options">
20+
<desc>A map of additional options to pass to the method.</desc>
21+
</argument>
22+
</signature>
1723
<signature>
1824
<added>1.4.3</added>
19-
<argument name="duration" type="String,Number" optional="true">
25+
<argument name="duration" type="String|Number" optional="true">
2026
<desc>A string or number determining how long the animation will run.</desc>
2127
</argument>
2228
<argument name="easing" type="String" optional="true">
@@ -26,6 +32,47 @@
2632
<desc>A function to call once the animation is complete.</desc>
2733
</argument>
2834
</signature>
35+
36+
<options>
37+
<option name="duration" type="Number|String" default="400">
38+
<desc>A string or number determining how long the animation will run.</desc>
39+
</option>
40+
<option name="easing" type="String" default="swing">
41+
<desc>A string indicating which easing function to use for the transition.</desc>
42+
</option>
43+
<option name="complete" type="Function">
44+
<desc>A function to call once the animation is complete.</desc>
45+
<!-- no parameters -->
46+
</option>
47+
<option name="step" type="Function">
48+
<desc>A function to be called after each step of the animation.</desc>
49+
<parameter name="now" type="Number">
50+
<desc>The numeric value of the property being animated at each step</desc>
51+
</parameter>
52+
<parameter name="fx" type="PlainObject">
53+
<desc>A map of properties related to the animation and the element being animated</desc>
54+
<property name="elem" type="DOM">
55+
<desc>The animated element</desc>
56+
</property>
57+
<property name="start" type="Number">
58+
<desc>The first value of the animated property</desc>
59+
</property>
60+
<property name="end" type="Number">
61+
<desc>The last value of the animated property</desc>
62+
</property>
63+
<property name="prop" type="String">
64+
<desc>The property being animated</desc>
65+
</property>
66+
</parameter>
67+
</option>
68+
<option name="queue" type="Boolean" default="true">
69+
<desc>A Boolean indicating whether to place the animation in the effects queue. If false, the animation will begin immediately. <strong>As of jQuery 1.7</strong>, the queue option can also accept a string, in which case the animation is added to the queue represented by that string.</desc>
70+
</option>
71+
<option name="specialEasing" type="PlainObject">
72+
<desc>A map of one or more of the CSS properties defined by the properties argument and their corresponding easing functions (added 1.4).</desc>
73+
</option>
74+
</options>
75+
2976
<longdesc>
3077
<p>With no parameters, the <code>.hide()</code> method is the simplest way to hide an element:</p>
3178
<pre>$('.target').hide();

entries/show.xml

+47
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@
1414
<desc>A function to call once the animation is complete.</desc>
1515
</argument>
1616
</signature>
17+
<signature>
18+
<added>1.0</added>
19+
<argument name="options" type="Options">
20+
<desc>A map of additional options to pass to the method.</desc>
21+
</argument>
22+
</signature>
1723
<signature>
1824
<added>1.4.3</added>
1925
<argument name="duration" type="String,Number" optional="true">
@@ -26,6 +32,47 @@
2632
<desc>A function to call once the animation is complete.</desc>
2733
</argument>
2834
</signature>
35+
36+
<options>
37+
<option name="duration" type="Number|String" default="400">
38+
<desc>A string or number determining how long the animation will run.</desc>
39+
</option>
40+
<option name="easing" type="String" default="swing">
41+
<desc>A string indicating which easing function to use for the transition.</desc>
42+
</option>
43+
<option name="complete" type="Function">
44+
<desc>A function to call once the animation is complete.</desc>
45+
<!-- no parameters -->
46+
</option>
47+
<option name="step" type="Function">
48+
<desc>A function to be called after each step of the animation.</desc>
49+
<parameter name="now" type="Number">
50+
<desc>The numeric value of the property being animated at each step</desc>
51+
</parameter>
52+
<parameter name="fx" type="PlainObject">
53+
<desc>A map of properties related to the animation and the element being animated</desc>
54+
<property name="elem" type="DOM">
55+
<desc>The animated element</desc>
56+
</property>
57+
<property name="start" type="Number">
58+
<desc>The first value of the animated property</desc>
59+
</property>
60+
<property name="end" type="Number">
61+
<desc>The last value of the animated property</desc>
62+
</property>
63+
<property name="prop" type="String">
64+
<desc>The property being animated</desc>
65+
</property>
66+
</parameter>
67+
</option>
68+
<option name="queue" type="Boolean" default="true">
69+
<desc>A Boolean indicating whether to place the animation in the effects queue. If false, the animation will begin immediately. <strong>As of jQuery 1.7</strong>, the queue option can also accept a string, in which case the animation is added to the queue represented by that string.</desc>
70+
</option>
71+
<option name="specialEasing" type="PlainObject">
72+
<desc>A map of one or more of the CSS properties defined by the properties argument and their corresponding easing functions (added 1.4).</desc>
73+
</option>
74+
</options>
75+
2976
<longdesc>
3077
<p>With no parameters, the <code>.show()</code> method is the simplest way to display an element:
3178
</p>

0 commit comments

Comments
 (0)