Skip to content

Commit 4156c93

Browse files
committed
fixed formatting to throttledresize entry
1 parent 19d8e77 commit 4156c93

File tree

1 file changed

+17
-21
lines changed

1 file changed

+17
-21
lines changed

entries/throttledresize.xml

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,31 +6,27 @@
66
<p>The jQuery Mobile <code>throttleresize</code> event is a special event that prevents browsers from running continuous callbacks on resize. <code>throttleresize</code> is used internally for orientationchange in browsers like Internet Explorer. <code>throttleresize</code> ensures that a held event will execute after the timeout so logic that depends on the final conditions after a resize is complete will still execute properly.</p>
77
<p>The <code>throttleresize</code> event is triggered if orientationchange is not natively supported.</p>
88
<p>This event triggers when the browser window resizes from:</p>
9-
<ol>
10-
<li>an orientation change (orientation-enabled device);</li>
11-
<li>changes in dimension ratio that replicates a landspace/portrait change (resizing a desktop browser).</li>
12-
</ol>
9+
<ol>
10+
<li>an orientation change (orientation-enabled device);</li>
11+
<li>changes in dimension ratio that replicates a landspace/portrait change (resizing a desktop browser).</li>
12+
</ol>
1313

1414
<xi:include href="../includes/core-extension-desc.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
15-
<pre>
16-
<code><![CDATA[
17-
var count = 0;
18-
$(function() {
19-
/*
20-
Bind an event handler to window's throttledresize event that, when triggered,
21-
passes a reference of itself that is accessible by the callback function.
22-
*/
23-
$(window).on( 'throttledresize', throttledresizeHandler );
15+
<pre><code><![CDATA[
16+
var count = 0;
17+
$(function() {
18+
// Bind an event handler to window throttledresize event that, when triggered,
19+
// passes a reference of itself that is accessible by the callback function.
20+
$( window ).on( "throttledresize", throttledresizeHandler );
2421
25-
function throttledresizeHandler( event ) {
26-
$( "#output-text" ).html( 'Event Count: ' + ++count );
27-
}
22+
function throttledresizeHandler( event ) {
23+
$( "#output-text" ).html( "Event Count: " + ++count );
24+
}
2825
29-
// You can also manually force this event to fire.
30-
$(window).trigger( "throttledresize" );
31-
});
32-
]]></code>
33-
</pre>
26+
// You can also manually force this event to fire.
27+
$( window ).trigger( "throttledresize" );
28+
});
29+
]]></code></pre>
3430
<p>Visit this from your orientation-enabled device to see it in action!
3531
<iframe id="throttledresizeIframe" src="/resources/throttledresize/example1.html" style="width:100%;height:90px;border:0px"></iframe></p>
3632

0 commit comments

Comments
 (0)