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
Copy file name to clipboardExpand all lines: docs/api/events.html
+14-11Lines changed: 14 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -48,17 +48,17 @@ <h2>Touch events</h2>
48
48
<dt><code>taphold</code></dt>
49
49
<dd><p>Triggers after a held complete touch event (close to one second).</p>
50
50
<ul>
51
-
<li><code>tapholdThreshold</code> (default: 750ms) – This value dictates how long the user must hold their tap before the taphold event is fired on the target element.</li>
51
+
<li><code>$.event.special.tap.tapholdThreshold</code> (default: 750ms) – This value dictates how long the user must hold their tap before the taphold event is fired on the target element.</li>
52
52
</ul>
53
53
</dd>
54
54
55
55
<dt><code>swipe</code></dt>
56
56
<dd><p>Triggers when a horizontal drag of 30px or more (and less than 20px vertically) occurs within 1 second duration but these can be configured:</p>
57
57
<ul>
58
-
<li><code>scrollSupressionThreshold</code> (default: 10px) – More than this horizontal displacement, and we will suppress scrolling</li>
59
-
<li><code>durationThreshold</code> (default: 1000ms) – More time than this, and it isn’t a swipe</li>
60
-
<li><code>horizontalDistanceThreshold</code> (default: 30px) – Swipe horizontal displacement must be more than this.</li>
61
-
<li><code>verticalDistanceThreshold</code> (default: 75px) – Swipe vertical displacement must be less than this.</li>
58
+
<li><code>$.event.special.swipe.scrollSupressionThreshold</code> (default: 10px) – More than this horizontal displacement, and we will suppress scrolling.</li>
59
+
<li><code>$.event.special.swipe.durationThreshold</code> (default: 1000ms) – More time than this, and it isn’t a swipe.</li>
60
+
<li><code>$.event.special.swipe.horizontalDistanceThreshold</code> (default: 30px) – Swipe horizontal displacement must be more than this.</li>
61
+
<li><code>$.event.special.swipe.verticalDistanceThreshold</code> (default: 75px) – Swipe vertical displacement must be less than this.</li>
62
62
</ul>
63
63
</dd>
64
64
@@ -73,16 +73,19 @@ <h2>Virtual mouse events</h2>
73
73
<p>We provide a set of "virtual" mouse events that attempt to abstract away mouse and touch events. This allows the developer to register listeners for the basic mouse events, such as mousedown, mousemove, mouseup, and click, and the plugin will take care of registering the correct listeners behind the scenes to invoke the listener at the fastest possible time for that device. In touch environments, the plugin retains the order of event firing that is seen in traditional mouse environments, so for example, vmouseup is always dispatched before vmousedown, and vmousedown before vclick, etc. The virtual mouse events also normalize how coordinate information is extracted from the event, so in touch based environments, coordinates are available from the pageX, pageY, screenX, screenY, clientX, and clientY properties, directly on the event object.</p>
74
74
<dl>
75
75
<dt><code>vmouseover</code></dt>
76
-
<dd>Normalized event for handling touch or <code>mouseover</code> events</dd>
76
+
<dd>Normalized event for handling touch or <code>mouseover</code> events</dd>
77
+
78
+
<dt><code>vmouseout</code></dt>
79
+
<dd>Normalized event for handling touch or <code>mouseout</code> events</dd>
77
80
78
81
<dt><code>vmousedown</code></dt>
79
-
<dd>Normalized event for handling touchstart or <code>mousedown</code> events</dd>
82
+
<dd>Normalized event for handling touchstart or <code>mousedown</code> events</dd>
80
83
81
84
<dt><code>vmousemove</code></dt>
82
-
<dd>Normalized event for handling touchmove or <code>mousemove</code> events</dd>
85
+
<dd>Normalized event for handling touchmove or <code>mousemove</code> events</dd>
83
86
84
87
<dt><code>vmouseup</code></dt>
85
-
<dd>Normalized event for handling touchend or <code>mouseup</code> events</dd>
88
+
<dd>Normalized event for handling touchend or <code>mouseup</code> events</dd>
86
89
87
90
<dt><code>vclick</code></dt>
88
91
<dd>Normalized event for handling touchend or mouse <code>click</code> events. On touch devices, this event is dispatched *AFTER* vmouseup. </dd>
<li>According to the jQuery Core <ahref="http://api.jquery.com/jQuery.ajax/">documentation</a>, this property may be an exception object if one occured, or if an HTTP error occured this will be set to the textual portion of the HTTP status. This is what gets passed as the 3rd argument to the framework's $.ajax() error callback.</li>
305
+
<li>According to the jQuery Core <ahref="http://api.jquery.com/jQuery.ajax/">documentation</a>, this property may be an exception object if one occurred, or if an HTTP error occurred this will be set to the textual portion of the HTTP status. This is what gets passed as the 3rd argument to the framework's $.ajax() error callback.</li>
<p>Internally, jQuery Mobile auto-initializes plugins based on the markup conventions found in a given "page". For example, an <code>input</code> element with a <code>type</code> of <code>range</code> will automatically generate a custom slider control.</p>
423
426
424
-
<p>This auto-initialization is controlled by the "page" plugin, which dispatches events before and after it executes, allowing you to manipulate a page either pre-or-post initialization, or even provide your own intialization behavior and prevent the auto-initializations from occuring. Note that these events will only fire once per "page", as opposed to the show/hide events, which fire every time a page is shown and hidden.</p>
427
+
<p>This auto-initialization is controlled by the "page" plugin, which dispatches events before and after it executes, allowing you to manipulate a page either pre-or-post initialization, or even provide your own initialization behavior and prevent the auto-initializations from occurring. Note that these events will only fire once per "page", as opposed to the show/hide events, which fire every time a page is shown and hidden.</p>
<dd>Show or hide the page loading message, which is configurable via <code>$.mobile.loader</code> prototype options as described in the <ahref="../docs/pages/loader.html">widget docs</a> or can be controlled via a params object.</dd>
187
+
<dd>Show or hide the page loading message, which is configurable via <code>$.mobile.loader</code> prototype options as described in the <ahref="../pages/loader.html">widget docs</a> or can be controlled via a params object.</dd>
<p>If you want to change the way in which list items are filtered, ie fuzzy search or matching from the beginning of the string, you can configure the callback used internally by defining <code>$.mobile.listview.prototype.options.filterCallback</code> during <code>mobileinit</code> or after the widget has been created with <code>$("#mylist").listview('option', 'filterCallback', yourFilterFunction)</code>. Any function defined for the callback will be provided two arguments. First, the text of the current list item and second, the value being searched for. A truthy value will result in a hidden list item. The default callback which filters entries without the <code>searchValue</code> as a substring is described below:
109
+
<p>If you want to change the way in which list items are filtered, ie fuzzy search or matching from the beginning of the string, you can configure the callback used internally by defining <code>$.mobile.listview.prototype.options.filterCallback</code> during <code>mobileinit</code> or after the widget has been created with <code>$("#mylist").listview('option', 'filterCallback', yourFilterFunction)</code>. Any function defined for the callback will be provided three arguments. First, the text of the current list item, second the value being searched for, and third the list item being filtered. A truthy value will result in a hidden list item. The default callback which filters entries without the <code>searchValue</code> as a substring is described below:
<p>To filter list items by values other than the text, add a <code>data-filtertext</code> attribute to the list item. The value of this attribute will be passed as the first argument to the <code>filterCallback</code> function instead of the text.</p>
116
+
<p>To filter list items by values other than the text, add a <code>data-filtertext</code> attribute to the list item. The value of this attribute will be passed as the first argument to the <code>filterCallback</code> function instead of the text. Alternately you can use an attribute of our choosing as defined on the list item itself.</p>
117
117
118
118
<ahref="lists-search-filtertext.html" data-role="button" data-icon="arrow-r" data-iconpos="right">Hidden data filter example</a>
Copy file name to clipboardExpand all lines: docs/pages/page-scripting.html
+3-2Lines changed: 3 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -113,9 +113,10 @@ <h2>Binding to mouse and touch events</h2>
113
113
114
114
115
115
<h2>Passing parameters between pages</h2>
116
-
<p>jQuery Mobile does not support query parameter passing to internal/embedded pages. For example, if the framework sees a link to <code>"#somePage?someId=1"</code> it interprets that as "#somePage" and navigates to the internal page div with an <code>id</code> of "somePage" and applies a data-url of "#somePage?someId=1" to that page container. Subsequent calls to other params such as <code>"#somePage?someId=2"<code> will find the same div because jQuery Mobile refers to the data-url on the div which is only set once and will remain at <code>"#somePage?someId=1"</code>.</p>
116
+
<p>jQuery Mobile does not support query parameter passing to internal/embedded pages. For example, if the framework sees a link to <code>"#somePage?someId=1"</code> it interprets that as <code>"#somePage"</code> and navigates to the internal page div with an <code>id</code> of <code>"somePage"</code> and applies a <code>data-url</code> of <code>"#somePage?someId=1"</code> to that page container.
117
+
Subsequent calls to other params such as <code>"#somePage?someId=2"</code> will find the same div because jQuery Mobile refers to the <code>data-url</code> on the <code>div</code> which is only set once and will remain at <code>"#somePage?someId=1"</code>.</p>
117
118
118
-
<p>There are two plugins that you can add to your project if query parameters are needed between pages. There is a lightweight <ahref="https://github.com/jblas/jquery-mobile-plugins/tree/master/page-params" rel="external">page params plugin</a> and a more fully featured <ahref="https://github.com/azicchetti/jquerymobile-router" rel="external">jQuery Mobile router plugin</a> for use with backbone.js or spine.js.</p>
119
+
<p>There are two plugins that can be added to your project if query parameters are needed between pages. There is a lightweight <ahref="https://github.com/jblas/jquery-mobile-plugins/tree/master/page-params" rel="external">page params plugin</a> and a more fully featured <ahref="https://github.com/azicchetti/jquerymobile-router" rel="external">jQuery Mobile router plugin</a> for use with backbone.js or spine.js.</p>
Copy file name to clipboardExpand all lines: docs/toolbars/docs-navbar.html
+15-2Lines changed: 15 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -27,12 +27,25 @@ <h1>Navbar</h1>
27
27
<h2>Simple navbar</h2>
28
28
29
29
<p>jQuery Mobile has a very basic navbar widget that is useful for providing up to 5 buttons with optional icons in a bar, typically within a header or footer. There is also a <ahref="footer-persist-a.html">persistent navbar</a> variation that works more like a tab bar that stays fixed as you navigate across pages.</p>
30
-
<p>A navbar is coded as an unordered list of links wrapped in a container element that has the <code> data-role="navbar"</code> attribute. To set one of the links to the active (selected) state, add <code>class="ui-btn-active"</code> to the anchor. In this example, we have a two-button navbar with the "One" item set to active:</p>
30
+
<p>A navbar is coded as an unordered list of links wrapped in a container element that has the <code> data-role="navbar"</code> attribute. This is an example of a two-button navbar:</p>
<p>When a link in the navbar is clicked it gets the active (selected) state. The <code>ui-btn-active</code> class is first removed from all anchors in the navbar before it is added to the activated link. If this is a link to another page, the class will be removed again after the transition has completed.</p>
42
+
43
+
<p>To set an item to the active state upon initialization of the navbar, add <code>class="ui-btn-active"</code> to the corresponding anchor in your markup. Additionaly add a class of <code>ui-state-persist</code> to make the framework restore the active state each time the page is shown while it exists in the DOM. The example below shows a navbar with item "One" set to active:</p>
0 commit comments