Skip to content

Commit 8ad89e8

Browse files
committed
finished cleaning up entry formatting/indentation
1 parent 5ba3fe2 commit 8ad89e8

21 files changed

Lines changed: 730 additions & 741 deletions

entries/stop.xml

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
<entry type='method' name="stop" return="jQuery">
32
<desc>Stop the currently-running animation on the matched elements.</desc>
43
<signature>
@@ -23,30 +22,32 @@
2322
</argument>
2423
</signature>
2524
<longdesc>
26-
<p>When <code>.stop()</code> is called on an element, the currently-running animation (if any) is immediately stopped. If, for instance, an element is being hidden with <code>.slideUp()</code> when <code>.stop()</code> is called, the element will now still be displayed, but will be a fraction of its previous height. Callback functions are not called.</p>
27-
<p>If more than one animation method is called on the same element, the later animations are placed in the effects queue for the element. These animations will not begin until the first one completes. When <code>.stop()</code> is called, the next animation in the queue begins immediately. If the <code>clearQueue</code> parameter is provided with a value of <code>true</code>, then the rest of the animations in the queue are removed and never run.</p>
28-
<p>If the <code>jumpToEnd</code> argument is provided with a value of <code>true</code>, the current animation stops, but the element is immediately given its target values for each CSS property. In our above <code>.slideUp()</code> example, the element would be immediately hidden. The callback function is then immediately called, if provided.</p>
29-
<p><strong>As of jQuery 1.7</strong>, if the first argument is provided as a string, only the animations in the queue represented by that string will be stopped.</p>
30-
<p>The usefulness of the <code>.stop()</code> method is evident when we need to animate an element on <code>mouseenter</code> and <code>mouseleave</code>:</p>
31-
<pre>&lt;div id="hoverme"&gt;
25+
<p>When <code>.stop()</code> is called on an element, the currently-running animation (if any) is immediately stopped. If, for instance, an element is being hidden with <code>.slideUp()</code> when <code>.stop()</code> is called, the element will now still be displayed, but will be a fraction of its previous height. Callback functions are not called.</p>
26+
<p>If more than one animation method is called on the same element, the later animations are placed in the effects queue for the element. These animations will not begin until the first one completes. When <code>.stop()</code> is called, the next animation in the queue begins immediately. If the <code>clearQueue</code> parameter is provided with a value of <code>true</code>, then the rest of the animations in the queue are removed and never run.</p>
27+
<p>If the <code>jumpToEnd</code> argument is provided with a value of <code>true</code>, the current animation stops, but the element is immediately given its target values for each CSS property. In our above <code>.slideUp()</code> example, the element would be immediately hidden. The callback function is then immediately called, if provided.</p>
28+
<p><strong>As of jQuery 1.7</strong>, if the first argument is provided as a string, only the animations in the queue represented by that string will be stopped.</p>
29+
<p>The usefulness of the <code>.stop()</code> method is evident when we need to animate an element on <code>mouseenter</code> and <code>mouseleave</code>:</p>
30+
<pre>&lt;div id="hoverme"&gt;
3231
Hover me
3332
&lt;img id="hoverme" src="book.png" alt="" width="100" height="123" /&gt;
3433
&lt;/div&gt;</pre>
35-
<p>We can create a nice fade effect without the common problem of multiple queued animations by adding <code>.stop(true, true)</code> to the chain:</p>
36-
<pre>$('#hoverme-stop-2').hover(function() {
34+
<p>We can create a nice fade effect without the common problem of multiple queued animations by adding <code>.stop(true, true)</code> to the chain:</p>
35+
<pre>$('#hoverme-stop-2').hover(function() {
3736
$(this).find('img').stop(true, true).fadeOut();
3837
}, function() {
3938
$(this).find('img').stop(true, true).fadeIn();
4039
});</pre>
4140

42-
<h2>Toggling Animations</h2>
43-
<p><strong>As of jQuery 1.7,</strong> stopping a toggled animation prematurely with <code>.stop()</code> will trigger jQuery's internal effects tracking. In previous versions, calling the <code>.stop()</code> method before a toggled animation was completed would cause the animation to lose track of its state (if jumpToEnd was false). Any subsequent animations would start at a new "half-way" state, sometimes resulting in the element disappearing. To observe the new behavior, see the final example below.</p>
41+
<h2>Toggling Animations</h2>
42+
<p><strong>As of jQuery 1.7,</strong> stopping a toggled animation prematurely with <code>.stop()</code> will trigger jQuery's internal effects tracking. In previous versions, calling the <code>.stop()</code> method before a toggled animation was completed would cause the animation to lose track of its state (if jumpToEnd was false). Any subsequent animations would start at a new "half-way" state, sometimes resulting in the element disappearing. To observe the new behavior, see the final example below.</p>
4443

45-
<blockquote><p>Animations may be stopped globally by setting the property <code>$.fx.off</code> to <code>true</code>. When this is done, all animation methods will immediately set elements to their final state when called, rather than displaying an effect.</p></blockquote>
46-
</longdesc>
47-
<example>
48-
<desc>Click the Go button once to start the animation, then click the STOP button to stop it where it's currently positioned. Another option is to click several buttons to queue them up and see that stop just kills the currently playing one.</desc>
49-
<code><![CDATA[
44+
<blockquote>
45+
<p>Animations may be stopped globally by setting the property <code>$.fx.off</code> to <code>true</code>. When this is done, all animation methods will immediately set elements to their final state when called, rather than displaying an effect.</p>
46+
</blockquote>
47+
</longdesc>
48+
<example>
49+
<desc>Click the Go button once to start the animation, then click the STOP button to stop it where it's currently positioned. Another option is to click several buttons to queue them up and see that stop just kills the currently playing one.</desc>
50+
<code><![CDATA[
5051
/* Start animation */
5152
$("#go").click(function(){
5253
$(".block").animate({left: '+=100px'}, 2000);
@@ -63,21 +64,21 @@ $(".block").animate({left: '-=100px'}, 2000);
6364
});
6465
6566
]]></code>
66-
<html><![CDATA[<button id="go">Go</button>
67+
<html><![CDATA[<button id="go">Go</button>
6768
<button id="stop">STOP!</button>
6869
<button id="back">Back</button>
6970
<div class="block"></div>]]></html>
70-
<css><![CDATA[div {
71-
position: absolute;
71+
<css><![CDATA[div {
72+
position: absolute;
7273
background-color: #abc;
7374
left: 0px;
7475
top:30px;
75-
width: 60px;
76+
width: 60px;
7677
height: 60px;
77-
margin: 5px;
78+
margin: 5px;
7879
}
7980
]]></css>
80-
</example>
81+
</example>
8182

8283
<example>
8384
<desc>Click the slideToggle button to start the animation, then click again before the animation is completed. The animation will toggle the other direction from the saved starting point.</desc>
@@ -88,12 +89,12 @@ $('#toggle').on('click', function() {
8889
$block.stop().slideToggle(1000);
8990
});
9091
]]></code>
91-
<html><![CDATA[<button id="toggle">slideToggle</button>
92+
<html><![CDATA[<button id="toggle">slideToggle</button>
9293
<div class="block"></div>]]></html>
93-
<css><![CDATA[.block {
94+
<css><![CDATA[.block {
9495
background-color: #abc;
9596
border: 2px solid black;
96-
width: 200px;
97+
width: 200px;
9798
height: 80px;
9899
margin: 10px;
99100
}

entries/submit-selector.xml

Lines changed: 110 additions & 127 deletions
Original file line numberDiff line numberDiff line change
@@ -1,142 +1,125 @@
1-
<entry type='selector' name="submit" return="">
2-
<sample>:submit</sample>
3-
<signature><added>1.0</added> </signature>
4-
<desc>Selects all elements of type submit.</desc>
5-
<longdesc><p>The <code>:submit</code> selector typically applies to button or input elements. Note that some browsers treat <code>&lt;button&gt;</code> element as <code>type="default"</code> implicitly while others (such as Internet Explorer) do not. </p></longdesc>
1+
<entry type='selector' name="submit" return="">
2+
<sample>:submit</sample>
3+
<signature><added>1.0</added> </signature>
4+
<desc>Selects all elements of type submit.</desc>
5+
<longdesc><p>The <code>:submit</code> selector typically applies to button or input elements. Note that some browsers treat <code>&lt;button&gt;</code> element as <code>type="default"</code> implicitly while others (such as Internet Explorer) do not. </p></longdesc>
66

77
<note id="jquery-selector-extension-alt" type="additional">
8-
<placeholder name="selector">:submit</placeholder>
9-
<placeholder name="alt">[type="submit"]</placeholder>
10-
</note>
11-
12-
13-
<example>
14-
<desc>Finds all submit elements that are descendants of a td element.</desc>
15-
<code><![CDATA[
16-
var submitEl = $("td :submit")
17-
.parent('td')
18-
.css({background:"yellow", border:"3px red solid"})
19-
.end();
20-
21-
$('#result').text('jQuery matched ' + submitEl.length + ' elements.');
22-
23-
// so it won't submit
24-
$("form").submit(function () { return false; });
25-
26-
// Extra JS to make the HTML easier to edit (None of this is relevant to the ':submit' selector
27-
$('#exampleTable').find('td').each(function(i, el) {
28-
var inputEl = $(el).children(),
29-
inputType = inputEl.attr('type') ? ' type="' + inputEl.attr('type') + '"' : '';
30-
$(el).before('<td>' + inputEl[0].nodeName + inputType + '</td>');
31-
})
32-
33-
8+
<placeholder name="selector">:submit</placeholder>
9+
<placeholder name="alt">[type="submit"]</placeholder>
10+
</note>
11+
12+
<example>
13+
<desc>Finds all submit elements that are descendants of a td element.</desc>
14+
<code><![CDATA[
15+
var submitEl = $("td :submit")
16+
.parent('td')
17+
.css({background:"yellow", border:"3px red solid"})
18+
.end();
19+
20+
$('#result').text('jQuery matched ' + submitEl.length + ' elements.');
21+
22+
// so it won't submit
23+
$("form").submit(function () { return false; });
24+
25+
// Extra JS to make the HTML easier to edit (None of this is relevant to the ':submit' selector
26+
$('#exampleTable').find('td').each(function(i, el) {
27+
var inputEl = $(el).children(),
28+
inputType = inputEl.attr('type') ? ' type="' + inputEl.attr('type') + '"' : '';
29+
$(el).before('<td>' + inputEl[0].nodeName + inputType + '</td>');
30+
})
3431
]]></code>
35-
<css><![CDATA[
32+
<css><![CDATA[
3633
textarea { height:45px; }
3734
]]></css>
38-
<html><![CDATA[
39-
<table>
35+
<html><![CDATA[
4036
<form>
4137
<table id="exampleTable" border="1" cellpadding="10" align="center">
42-
43-
<tr>
44-
<th>
45-
Element Type
46-
</th>
47-
<th>
48-
Element
49-
</th>
50-
51-
</tr
52-
<tr>
53-
<td>
54-
<input type="button" value="Input Button"/>
55-
</td>
56-
57-
</tr>
58-
<tr>
59-
<td>
60-
<input type="checkbox" />
61-
</td>
62-
63-
</tr>
64-
<tr>
65-
<td>
66-
<input type="file" />
67-
</td>
68-
69-
</tr>
70-
<tr>
71-
<td>
72-
<input type="hidden" />
73-
</td>
74-
75-
</tr>
76-
<tr>
77-
<td>
78-
<input type="image" />
79-
</td>
80-
81-
</tr>
82-
<tr>
83-
<td>
84-
<input type="password" />
85-
</td>
86-
87-
</tr>
88-
<tr>
89-
<td>
90-
<input type="radio" />
91-
</td>
92-
93-
</tr>
94-
<tr>
95-
<td>
96-
<input type="reset" />
97-
</td>
98-
99-
</tr>
100-
<tr>
101-
<td>
102-
<input type="submit" />
103-
</td>
104-
105-
</tr>
106-
<tr>
107-
<td>
108-
<input type="text" />
109-
</td>
110-
111-
</tr>
112-
<tr>
113-
<td>
114-
<select><option>Option</option></select>
115-
</td>
116-
117-
</tr>
118-
<tr>
119-
<td>
120-
<textarea></textarea>
121-
</td>
122-
</tr>
123-
124-
<tr>
125-
<td>
126-
<button>Button</button>
127-
</td>
128-
</tr>
129-
<tr>
130-
<td>
131-
<button type="submit">Button type="submit"</button>
132-
</td>
133-
</tr>
38+
<tr>
39+
<th>
40+
Element Type
41+
</th>
42+
<th>
43+
Element
44+
</th>
45+
</tr>
46+
<tr>
47+
<td>
48+
<input type="button" value="Input Button"/>
49+
</td>
50+
</tr>
51+
<tr>
52+
<td>
53+
<input type="checkbox" />
54+
</td>
55+
</tr>
56+
<tr>
57+
<td>
58+
<input type="file" />
59+
</td>
60+
</tr>
61+
<tr>
62+
<td>
63+
<input type="hidden" />
64+
</td>
65+
</tr>
66+
<tr>
67+
<td>
68+
<input type="image" />
69+
</td>
70+
</tr>
71+
<tr>
72+
<td>
73+
<input type="password" />
74+
</td>
75+
</tr>
76+
<tr>
77+
<td>
78+
<input type="radio" />
79+
</td>
80+
81+
</tr>
82+
<tr>
83+
<td>
84+
<input type="reset" />
85+
</td>
86+
</tr>
87+
<tr>
88+
<td>
89+
<input type="submit" />
90+
</td>
91+
</tr>
92+
<tr>
93+
<td>
94+
<input type="text" />
95+
</td>
96+
</tr>
97+
<tr>
98+
<td>
99+
<select><option>Option</option></select>
100+
</td>
101+
</tr>
102+
<tr>
103+
<td>
104+
<textarea></textarea>
105+
</td>
106+
</tr>
107+
<tr>
108+
<td>
109+
<button>Button</button>
110+
</td>
111+
</tr>
112+
<tr>
113+
<td>
114+
<button type="submit">Button type="submit"</button>
115+
</td>
116+
</tr>
134117
135118
</table>
136119
</form>
137120
<div id="result"></div>
138121
]]></html>
139-
</example>
122+
</example>
140123
<category name="Form" slug="form-selectors"/>
141124
<category name="jQuery Extensions" slug="jquery-selector-extensions"/>
142125
<category name="Version 1.0" slug="1.0"/>

0 commit comments

Comments
 (0)