You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<p>Note that by binding to <code>pagebeforecreate</code> and returning <code>false</code>, you can prevent the page plugin from making its manipulations.</p>
65
65
66
+
<divclass="ui-body ui-body-e">
67
+
<p><strong>Note on Page IDs: </strong> Page elements in jQuery Mobile utilize the <code>ID</code> attribute for storing the location from which they came. When you place an <code>ID</code> attribute on a page that is brought into jQuery Mobile's single-page environment through Ajax, jQuery Mobile wraps that page with a new "page" <code>div</code> element, preserving any CSS references to your <code>ID</code>. However, this means that your <code>ID</code> attribute is no longer on the "page" element, so you must keep this in mind when binding to page events (<code>pagebeforecreate</code>, <code>pagecreate</code>, etc). To avoid issues, try using a class if possible. </p>
68
+
</div>
69
+
70
+
66
71
<h3>Animation Events</h3>
67
-
<p>Currently, jQuery Mobile exposes the <code>animationComplete</code>event, which you can utilize after adding or removing a class that applies a CSS transition.</p>
72
+
<p>jQuery Mobile exposes the <code>animationComplete</code>plugin, which you can utilize after adding or removing a class that applies a CSS transition.</p>
<dd>The url parameter used for referencing widget-generated sub-pages (such as those generated by nested listviews). Translates to to <em>example.html<strong>&ui-page=</strong>subpageIdentifier</em>. The hash segment before &ui-page= is used by the framework for making an Ajax request to the URL where the sub-page exists.</dd>
<dd>Anchor links with a data-rel attribute value, or pages with a data-role value, that match these selectors will not be trackable in history (they won't update the location.hash and won't be bookmarkable).</dd>
<h2>Working with jQuery Mobile's Auto-initialization</h2>
19
+
<p>Unlike other jQuery projects, such as jQuery and jQuery UI, jQuery Mobile automatically applies many markup enhancements as soon as it loads (long before document.ready event fires). These enhancements are applied based on jQuery Mobile's default configuration, which is designed to work with common scenarios, but may or may not match your particular needs. Fortunately, these settings are easy to configure.</p>
20
+
21
+
<h3>The mobileinit event</h3>
22
+
<p>When the jQuery Mobile starts to execute, it triggers a <code>mobileinit</code> event on the <code>document</code> object, to which you can bind to apply overrides to jQuery Mobile's defaults.</p>
23
+
24
+
<pre>
25
+
<code>
26
+
$(document).bind("mobileinit", function(){
27
+
//apply overrides here
28
+
});
29
+
</code>
30
+
</pre>
31
+
32
+
<p>Because the <code>mobileinit</code> event is triggered immediately upon execution, you'll need to bind your event handler before jQuery Mobile is loaded. Thus, we recommend linking to your JavaScript files in the following order:</p>
<p>Within this event binding, you can configure defaults either by extending the <code>$.mobile</code> object using jQuery's <code>$.extend</code> method:</p>
43
+
44
+
<pre>
45
+
<code>
46
+
$(document).bind("mobileinit", function(){
47
+
$.extend( $.mobile , {
48
+
<strong>foo: bar</strong>
49
+
});
50
+
});
51
+
</code>
52
+
</pre>
53
+
54
+
<p>...or by setting them individually:</p>
55
+
<pre>
56
+
<code>
57
+
$(document).live("mobileinit", function(){
58
+
<strong>$.mobile.foo = bar;</strong>
59
+
});
60
+
</code>
61
+
</pre>
62
+
63
+
<p>Visit the <ahref="global-settings.html">Configurable Default Settings</a> page for information on the configurable defaults.</p>
0 commit comments