Skip to content

Commit ad91aea

Browse files
committed
resize: Deprecate the API
1 parent 6ed0e96 commit ad91aea

File tree

2 files changed

+61
-51
lines changed

2 files changed

+61
-51
lines changed

entries/resize-shorthand.xml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0"?>
2-
<entry type="method" name="focusout" return="jQuery" deprecated="3.3">
3-
<title>.focusout()</title>
4-
<desc>Bind an event handler to the "focusout" JavaScript event, or trigger that event on an element.</desc>
2+
<entry type="method" name="resize" return="jQuery" deprecated="3.3">
3+
<title>.resize()</title>
4+
<desc>Bind an event handler to the "resize" JavaScript event, or trigger that event on an element.</desc>
55
<signature>
66
<added>1.0</added>
77
<argument name="handler" type="Function">
@@ -25,13 +25,12 @@
2525
<longdesc>
2626
<div class="warning">
2727
<p>This API is deprecated.</p>
28-
<p>Instead of <code>.focusout( handler )</code> or <code>.focusout( eventData, handler )</code>, use <a href="/focusout/#on1"><code>.on( "focusout", handler )</code></a> or <a href="/focusout/#on1"><code>.on( "focusout", eventData, handler )</code></a>, respectively.</p>
29-
<p>Instead of <code>.focusout()</code>, use <a href="/focusout/#trigger2"><code>.trigger( "focusout" )</code></a>.</p>
28+
<p>Instead of <code>.resize( handler )</code> or <code>.resize( eventData, handler )</code>, use <a href="/resize/#on1"><code>.on( "resize", handler )</code></a> or <a href="/resize/#on1"><code>.on( "resize", eventData, handler )</code></a>, respectively.</p>
29+
<p>Instead of <code>.resize()</code>, use <a href="/resize/#trigger2"><code>.trigger( "resize" )</code></a>.</p>
3030
</div>
3131
</longdesc>
32-
<category slug="events/form-events"/>
33-
<category slug="forms"/>
34-
<category slug="version/1.4"/>
32+
<category slug="events/browser-events"/>
33+
<category slug="version/1.0"/>
3534
<category slug="version/1.4.3"/>
3635
<category slug="deprecated/deprecated-3.3"/>
3736
</entry>

entries/resize.xml

Lines changed: 54 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,58 @@
11
<?xml version="1.0"?>
2-
<entry type="method" name="resize" return="jQuery">
3-
<title>.resize()</title>
2+
<entries>
43
<desc>Bind an event handler to the "resize" JavaScript event, or trigger that event on an element.</desc>
5-
<signature>
6-
<added>1.0</added>
7-
<argument name="handler" type="Function">
8-
<desc>A function to execute each time the event is triggered.</desc>
9-
<argument name="eventObject" type="Event" />
10-
</argument>
11-
</signature>
12-
<signature>
13-
<added>1.4.3</added>
14-
<argument name="eventData" type="Anything" optional="true">
15-
<desc>An object containing data that will be passed to the event handler.</desc>
16-
</argument>
17-
<argument name="handler" type="Function">
18-
<desc>A function to execute each time the event is triggered.</desc>
19-
<argument name="eventObject" type="Event" />
20-
</argument>
21-
</signature>
22-
<signature>
23-
<added>1.0</added>
24-
</signature>
25-
<longdesc>
26-
<p>This method is a shortcut for <code>.on('resize', handler)</code> in the first and second variations, and <code>.trigger( "resize" )</code> in the third.</p>
27-
<p>The <code>resize</code> event is sent to the <code>window</code> element when the size of the browser window changes:</p>
28-
<pre><code>
29-
$( window ).resize(function() {
30-
$( "#log" ).append( "&lt;div&gt;Handler for .resize() called.&lt;/div&gt;" );
31-
});
32-
</code></pre>
33-
<p>Now whenever the browser window's size is changed, the message is appended to &lt;div id="log"&gt; one or more times, depending on the browser.</p>
34-
<p>Code in a <code>resize</code> handler should never rely on the number of times the handler is called. Depending on implementation, <code>resize</code> events can be sent continuously as the resizing is in progress (the typical behavior in Internet Explorer and WebKit-based browsers such as Safari and Chrome), or only once at the end of the resize operation (the typical behavior in some other browsers such as Opera).</p>
35-
</longdesc>
36-
<example>
37-
<desc>To see the window width while (or after) it is resized, try:</desc>
38-
<code><![CDATA[
39-
$( window ).resize(function() {
4+
<entry type="method" name="on" return="jQuery">
5+
<title>resize event</title>
6+
<desc>Bind an event handler to the "resize" JavaScript event.</desc>
7+
<signature>
8+
<added>1.7</added>
9+
<argument name="&quot;resize&quot;" type="string">
10+
<desc>The string <code>"resize"</code>.</desc>
11+
</argument>
12+
<argument name="eventData" type="Anything" optional="true">
13+
<desc>An object containing data that will be passed to the event handler.</desc>
14+
</argument>
15+
<argument name="handler" type="Function">
16+
<desc>A function to execute each time the event is triggered.</desc>
17+
<argument name="eventObject" type="Event" />
18+
</argument>
19+
</signature>
20+
<longdesc>
21+
<p>The <code>resize</code> event is sent to the <code>window</code> element when the size of the browser window changes:</p>
22+
<pre><code>
23+
$( window ).on( "resize", function() {
24+
$( "#log" ).append( "&lt;div&gt;Handler for `resize` called.&lt;/div&gt;" );
25+
} );
26+
</code></pre>
27+
<p>Now whenever the browser window's size is changed, the message is appended to &lt;div id="log"&gt; one or more times, depending on the browser.</p>
28+
<p>Code in a <code>resize</code> handler should never rely on the number of times the handler is called. Depending on implementation, <code>resize</code> events can be sent continuously as the resizing is in progress (the typical behavior in Internet Explorer and WebKit-based browsers such as Safari and Chrome), or only once at the end of the resize operation (the typical behavior in some other browsers such as Opera).</p>
29+
</longdesc>
30+
<example>
31+
<desc>To see the window width while (or after) it is resized, try:</desc>
32+
<code><![CDATA[
33+
$( window ).( "resize", function() {
4034
$( "body" ).prepend( "<div>" + $( window ).width() + "</div>" );
41-
});
35+
} );
4236
]]></code>
43-
</example>
44-
<category slug="events/browser-events"/>
45-
<category slug="version/1.0"/>
46-
<category slug="version/1.4.3"/>
47-
</entry>
37+
</example>
38+
<category slug="events/browser-events"/>
39+
<category slug="version/1.0"/>
40+
<category slug="version/1.7"/>
41+
</entry>
42+
43+
<entry type="method" name="trigger" return="jQuery">
44+
<title>resize event</title>
45+
<desc>Trigger the "resize" event on an element.</desc>
46+
<signature>
47+
<added>1.0</added>
48+
<argument name="&quot;resize&quot;" type="string">
49+
<desc>The string <code>"resize"</code>.</desc>
50+
</argument>
51+
</signature>
52+
<longdesc>
53+
<p>See the description for <a href="#on1"><code>.on( "resize", ... )</code></a>.</p>
54+
</longdesc>
55+
<category slug="events/browser-events"/>
56+
<category slug="version/1.0"/>
57+
</entry>
58+
</entries>

0 commit comments

Comments
 (0)