|
1 | 1 | <?xml version="1.0"?>
|
2 |
| -<entry type="method" name="resize" return="jQuery"> |
3 |
| - <title>.resize()</title> |
| 2 | +<entries> |
4 | 3 | <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( "<div>Handler for .resize() called.</div>" ); |
31 |
| -}); |
32 |
| - </code></pre> |
33 |
| - <p>Now whenever the browser window's size is changed, the message is appended to <div id="log"> 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=""resize"" 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( "<div>Handler for `resize` called.</div>" ); |
| 25 | +} ); |
| 26 | + </code></pre> |
| 27 | + <p>Now whenever the browser window's size is changed, the message is appended to <div id="log"> 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() { |
40 | 34 | $( "body" ).prepend( "<div>" + $( window ).width() + "</div>" );
|
41 |
| -}); |
| 35 | +} ); |
42 | 36 | ]]></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=""resize"" 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