Large diffs are not rendered by default.

@@ -10,77 +10,77 @@
<p>The framework will find all <code>input</code> elements with a <code>type="range"</code> and automatically enhance them into a slider with an accompanying input without any need to apply a <code>data-role</code> attribute. To prevent the automatic enhancement of this input into a slider, add <code>data-role="none"</code> attribute to the input and wrap them in a <code>div</code> with the <code>data-role="fieldcontain"</code> attribute to group them. </p>
<p>In this example, the acceptable range is 0-100.</p>

<pre><code>
&lt;div data-role="rangeslider"&gt;
&lt;label for="range-1a"&gt;Rangeslider:&lt;/label&gt;
&lt;input name="range-1a" id="range-1a" min="0" max="100" value="0" type="range" /&gt;
&lt;label for="range-1b"&gt;Rangeslider:&lt;/label&gt;
&lt;input name="range-1b" id="range-1b" min="0" max="100" value="100" type="range" /&gt;
&lt;/div&gt;
</code></pre>
<pre><code><![CDATA[
<div data-role="rangeslider">
<label for="range-1a">Rangeslider:</label>
<input name="range-1a" id="range-1a" min="0" max="100" value="0" type="range" />
<label for="range-1b">Rangeslider:</label>
<input name="range-1b" id="range-1b" min="0" max="100" value="100" type="range" />
</div>
]]></code></pre>

<p>The default rangeslider with these settings is displayed like this:
<iframe src="/resources/rangeslider/example1.html" style="width:100%;height:90px;border:0px"></iframe></p>

<h3>Step increment</h3>
<p>To force the range to snap to a specific increment, add the <code>step</code> attribute to the input. By default, the step is 1, but in this example, the step is 0.1 and the maximum value is 10.</p>
<p>In this example, the acceptable range is 0-100.</p>

<pre><code>
&lt;div data-role="rangeslider"&gt;
&lt;label for="range-10a"&gt;Rangeslider:&lt;/label&gt;
&lt;input name="range-10a" id="range-10a" min="0" max="10" step=".1" value="0" type="range" /&gt;
&lt;label for="range-10b"&gt;Rangeslider:&lt;/label&gt;
&lt;input name="range-10b" id="range-10b" min="0" max="10" step=".1" value="10" type="range" /&gt;
&lt;/div&gt;
</code></pre>
<pre><code><![CDATA[
<div data-role="rangeslider">
<label for="range-10a">Rangeslider:</label>
<input name="range-10a" id="range-10a" min="0" max="10" step=".1" value="0" type="range" />
<label for="range-10b">Rangeslider:</label>
<input name="range-10b" id="range-10b" min="0" max="10" step=".1" value="10" type="range" />
</div>
]]></code></pre>

<p>This will produce an input that snaps to increments of 0.1. If a value is added to the input that isn't valid with the step increment, the value will be reset on blur to the closest step.
<iframe src="/resources/rangeslider/example2.html" style="width:100%;height:90px;border:0px"></iframe></p>

<h3>Fill highlight</h3>

<p>By default, there is a highlight fill on the track between the two slider handles. To remove it, add the <code>data-highlight="false"</code> attribute to the input. The fill uses active state swatch. </p>
<pre><code>
&lt;div data-role="rangeslider" data-highlight="false"&gt;
&lt;label for="range-2a"&gt;Rangeslider (default is "true"):&lt;/label&gt;
&lt;input name="range-2a" id="range-2a" min="0" max="100" value="0" type="range" /&gt;
&lt;label for="range-2b"&gt;Rangeslider:&lt;/label&gt;
&lt;input name="range-2b" id="range-2b" min="0" max="100" value="100" type="range" /&gt;
&lt;/div&gt;
</code></pre>

<pre><code><![CDATA[
<div data-role="rangeslider" data-highlight="false">
<label for="range-2a">Rangeslider (default is "true"):</label>
<input name="range-2a" id="range-2a" min="0" max="100" value="0" type="range" />
<label for="range-2b">Rangeslider:</label>
<input name="range-2b" id="range-2b" min="0" max="100" value="100" type="range" />
</div>
]]></code></pre>

<iframe src="/resources/rangeslider/example3.html" style="width:100%;height:90px;border:0px"></iframe>

<h3>Theming the slider</h3>

<p>To set the theme swatch for the rangeslider, add a <code>data-theme</code> attribute to the <code>inputs</code> which will apply the theme to the inputs, handles and track. The track swatch can be set separately by adding the <code>data-track-theme</code> attribute to apply the down state version of the selected button swatch.</p>

<pre><code>
&lt;div data-role="rangeslider" data-track-theme="b" data-theme="a"&gt;
&lt;label for="range-3a"&gt;Rangeslider:&lt;/label&gt;
&lt;input name="range-3a" id="range-3a" min="0" max="100" value="0" type="range" /&gt;
&lt;label for="range-3b"&gt;Rangeslider:&lt;/label&gt;
&lt;input name="range-3b" id="range-3b" min="0" max="100" value="100" type="range" /&gt;
&lt;/div&gt;
</code></pre>
<pre><code><![CDATA[
<div data-role="rangeslider" data-track-theme="b" data-theme="a">
<label for="range-3a">Rangeslider:</label>
<input name="range-3a" id="range-3a" min="0" max="100" value="0" type="range" />
<label for="range-3b">Rangeslider:</label>
<input name="range-3b" id="range-3b" min="0" max="100" value="100" type="range" />
</div>
]]></code></pre>

<p>This will produce a themed rangeslider:
<iframe src="/resources/rangeslider/example4.html" style="width:100%;height:90px;border:0px"></iframe></p>

<h3>Mini version</h3>

<p>For a more compact version that is useful in toolbars and tight spaces, add the <code>data-mini="true"</code> attribute to the element to create a mini version. </p>

<pre><code>
&lt;div data-role="rangeslider" data-mini="true"&gt;
&lt;label for="range-4a"&gt;Rangeslider:&lt;/label&gt;
&lt;input name="range-4a" id="range-4a" min="0" max="100" value="0" type="range" /&gt;
&lt;label for="range-4b"&gt;Rangeslider:&lt;/label&gt;
&lt;input name="range-4b" id="range-4b" min="0" max="100" value="100" type="range" /&gt;
&lt;/div&gt;
</code></pre>
<pre><code><![CDATA[
<div data-role="rangeslider" data-mini="true">
<label for="range-4a">Rangeslider:</label>
<input name="range-4a" id="range-4a" min="0" max="100" value="0" type="range" />
<label for="range-4b">Rangeslider:</label>
<input name="range-4b" id="range-4b" min="0" max="100" value="100" type="range" />
</div>
]]></code></pre>

<p>This will produce a rangeslider and its corresponding inputs that are not as tall as the standard version. The inputs also have a smaller text size.
<iframe src="/resources/rangeslider/example5.html" style="width:100%;height:90px;border:0px"></iframe></p>
@@ -89,30 +89,30 @@

<p>Optionally wrap the rangeslider markup in a container with the <code>data-role="fieldcontain"</code> attribute to help visually group it in a longer form. In this example, the step attribute is omitted to allow any whole number value to be selected.</p>

<pre><code>
&lt;div data-role="fieldcontain"&gt;
&lt;div data-role="rangeslider"&gt;
&lt;label for="range-7a"&gt;Rangeslider:&lt;/label&gt;
&lt;input name="range-7a" id="range-7a" min="0" max="100" value="0" type="range" /&gt;
&lt;label for="range-7b"&gt;Rangeslider:&lt;/label&gt;
&lt;input name="range-7b" id="range-7b" min="0" max="100" value="100" type="range" /&gt;
&lt;/div&gt;
&lt;/div&gt;
</code></pre>
<pre><code><![CDATA[
<div data-role="fieldcontain">
<div data-role="rangeslider">
<label for="range-7a">Rangeslider:</label>
<input name="range-7a" id="range-7a" min="0" max="100" value="0" type="range" />
<label for="range-7b">Rangeslider:</label>
<input name="range-7b" id="range-7b" min="0" max="100" value="100" type="range" />
</div>
</div>
]]></code></pre>

<p>The rangeslider is now displayed like this:
<iframe src="/resources/rangeslider/example6.html" style="width:100%;height:90px;border:0px"></iframe></p>

<p>Sliders also respond to key commands. Right Arrow, Up Arrow and Page Up keys increase the value; Left Arrow, Down Arrow and Page Down keys decrease it. To move the slider to its minimum or maximum value, use the Home or End key, respectively.</p>

<h3>Calling the rangeslider plugin</h3>

<p>This plugin will auto initialize on any page that contains a text input with the <code>type="range"</code> attribute. However, if needed you can directly call the rangeslider plugin on any selector, just like any jQuery plugin:</p>

<pre><code>
<pre><code><![CDATA[
$( "input" ).rangeslider();
</code></pre>
]]></code></pre>

</longdesc>
<added>1.3</added>
<options>
@@ -126,11 +126,11 @@ $( "input" ).rangeslider();
</option>
<option name="initSelector" default='"input[type=&#39;rangeslider&#39;], :jqmData(type=&#39;range&#39;), :jqmData(role=&#39;slider&#39;)"'>
<desc>This is used to define the selectors (element types, data roles, etc.) that will automatically be initialized as rangesliders. To change which elements are initialized, bind this option to the mobileinit event:
<pre><code>
<pre><code><![CDATA[
$( document ).on( "mobileinit", function() {
$.mobile.rangeslider.prototype.options.initSelector = ".myrangeslider";
});
</code></pre>
]]></code></pre>
</desc>
<type name="CSS selector string" />
</option>
@@ -157,14 +157,14 @@ $( document ).on( "mobileinit", function() {
</options>
<events>
<event name="create">
<desc>triggered when a rangeslider is created</desc>
<desc>triggered when a rangeslider is created</desc>
<argument name="event" type="Event">
</argument>
<argument name="ui" type="Object">
</argument>
</event>
<event name="normalize">
<desc>triggered when the input values are normalized (generally happens when you try to drag one handle past the other).</desc>
<desc>triggered when the input values are normalized (generally happens when you try to drag one handle past the other).</desc>
<argument name="event" type="Event">
<desc></desc>
</argument>
@@ -4,103 +4,102 @@
<title>Responsive Grid</title>
<desc>Reponsive layout grids</desc>
<longdesc>

<h3>Responsive grids</h3>

<p>When using <a href="../grid-layout/">layout grids</a> for building full-level layouts, it may make sense to apply responsive web design (RWD) principles to ensure that the layout adapts to a wide range screen widths.</p>
<p>The simplest form of responsive behavior swaps from a stacked layout on narrow screens like a smartphone to the multi-column grid layouts at wider screens. This can be done by targeting styles to specific screen widths by using CSS media queries.</p>

<h3>Making the grids responsive</h3>

<p>By default, the grid classes will result in a multi column layout across all screen widths. The styles to make the grids responsive are added by applying a media query with rules to switch to the stacked style presentation below a specific screen width.</p>

<p>We normally recommend starting with mobile-first approach for media queries: starting with the styles that apply to the smallest screen sizes in the core widget styles, then progressively layering breakpoints up to larger screens by using <code>min-width</code> media queries.</p>
<p>However, in the case of grids we can use a <code>max-width</code> media query to only apply the stacked grid styles <em>below</em> a width breakpoint. This allows us to leverage all the default grid styles but just tweak them at narrow widths.</p>


<p>Without the custom styles, our grid will be a 3 column layout across all screen widths:</p>

<iframe src="/resources/responsive-grid/example1.html" style="width:100%;height:112px;border:0"></iframe>

<p>In our custom styles, we want this grid to stack at narrow widths, then switch to a standard 3 column layout. At very wide screen widths, we want first column to take up 50% of the width, like this:</p>

<iframe src="/resources/responsive-grid/example2.html" style="width:100%;height:112px;border:0"></iframe>

<p>To make this responsive, start by adding the <code>my-breakpoint</code> class to the grid container that references the custom breakpoint in your custom stylesheet:</p>

<pre><code>
&lt;div class=&quot;ui-grid-b my-breakpoint&quot;&gt;
&lt;div class=&quot;ui-block-a&quot;&gt;Block A&lt;/div&gt;
&lt;div class=&quot;ui-block-b&quot;&gt;Block B&lt;/div&gt;
&lt;div class=&quot;ui-block-c&quot;&gt;Block C&lt;/div&gt;
&lt;/div&gt;&lt;!-- /grid-b --&gt;
</code></pre>
<pre><code><![CDATA[
<div class="ui-grid-b my-breakpoint">
<div class="ui-block-a">Block A</div>
<div class="ui-block-b">Block B</div>
<div class="ui-block-c">Block C</div>
</div><!-- /grid-b -->
]]></code></pre>

<h4>Adding the stack breakpoint at narrow widths</h4>

<p>This class is used to scope the styles within the custom media query so they will only apply when this class is added to the grid container. The media query wraps the conditional styles we only want applied below 50em. </p>
<p>In your media queries, use em units instead of pixels to ensure that the media query will take font size into account in addition to just screen width. To calculate a screen widths in ems, divide the target width in pixels by 16 which is the default font size of the body.</p>
<pre><code>

<pre><code><![CDATA[
@media all and (max-width: 50em) {
.my-breakpoint .ui-block-a,
.my-breakpoint .ui-block-b,
.my-breakpoint .ui-block-a,
.my-breakpoint .ui-block-b,
.my-breakpoint .ui-block-c,
.my-breakpoint .ui-block-d,
.my-breakpoint .ui-block-e {
width: 100%;
float:none;
.my-breakpoint .ui-block-e {
width: 100%;
float:none;
}
}
</code></pre>
]]></code></pre>

<p>Within this media query, we set the width to 100% and negate the float property to make the grid blocks stack below 50em screen widths. These rules are applied to every <a href="content-grids.html">grid type</a> by stacking up selectors for all the grid classes from <code>ui-block-a</code> to <code>ui-block-e</code> on the styles.</p>



<p>That is all it takes to make grids responsive and it's easy to add additional styling rules to each breakpoint to change it up even more. We encourage you to create as many custom breakpoints as you need based on your unique content and layout needs.</p>

<h4>Adding a widescreen breakpoint to adjust ratios</h4>

<p>Building on the example above, we can add an additional breakpoint to shift the widths to make the first column 50% width and the other two 25% above 75em (1,200 pixels) by layering an additional <code>min-width</code> media query to tweak widths in our custom style like this:</p>
<pre><code>

<pre><code><![CDATA[
@media all and (min-width: 75em) {
.my-breakpoint.ui-grid-b .ui-block-a { width: 49.95%; }
.my-breakpoint.ui-grid-b .ui-block-b,
.my-breakpoint.ui-grid-b .ui-block-b,
.my-breakpoint.ui-grid-b .ui-block-c { width: 24.925%; }
.my-breakpoint.ui-grid-b .ui-block-a { clear: left; }
}
}
</code></pre>
}
]]></code></pre>

<p>Note the slightly narrower widths set to work around rounding issues across platforms. </p>

<h3>Applying a preset breakpoint</h3>

<p>Even though we strongly encourage you to write custom breakpoints yourself, the framework includes a single pre-configured breakpoint that targets the stacked style to smaller phones and swaps to the multi-column presentation on larger phones, tablet and desktop devices. </p>
<p>To use this preset breakpoint, add the <code>ui-responsive</code> class to the grid container to apply the stacked presentation <em>below</em> 560px (35em). If this breakpoint doesn't work for your content, we encourage you to write a custom breakpoint as described above.</p>

<pre><code>&lt;div class=&quot;ui-grid-b ui-responsive&quot;&gt;</code></pre>
<p>These are standard grids that are made responsive by <code>ui-responsive</code> class to the grid container:</p>
<pre><code><![CDATA[
<div class="ui-grid-b ui-responsive">
]]></code></pre>

<p>These are standard grids that are made responsive by <code>ui-responsive</code> class to the grid container:</p>

<h4>Grid A (50/50)</h4>

<iframe src="/resources/responsive-grid/example3.html" style="width:100%;height:132px;border:0"></iframe>

<h4>Grid B (33/33/33)</h4>

<iframe src="/resources/responsive-grid/example4.html" style="width:100%;height:152px;border:0"></iframe>

<h4>Grid C (25/25/25/25)</h4>

<iframe src="/resources/responsive-grid/example5.html" style="width:100%;height:172px;border:0"></iframe>

<h4>Grid D (20/20/20/20/20)</h4>

<iframe src="/resources/responsive-grid/example6.html" style="width:100%;height:192px;border:0"></iframe>

</longdesc>
<added>1.3</added>
<options>
@@ -114,19 +113,19 @@
<desc>A basic example of responsive grids</desc>
<css><![CDATA[
@media all and (max-width: 35em) {
.my-breakpoint .ui-block-a,
.my-breakpoint .ui-block-b,
.my-breakpoint .ui-block-a,
.my-breakpoint .ui-block-b,
.my-breakpoint .ui-block-c,
.my-breakpoint .ui-block-d,
.my-breakpoint .ui-block-e {
width: 100%;
float:none;
.my-breakpoint .ui-block-e {
width: 100%;
float:none;
}
}
@media all and (min-width: 45em) {
.my-breakpoint.ui-grid-b .ui-block-a { width: 49.95%; }
.my-breakpoint.ui-grid-b .ui-block-b,
.my-breakpoint.ui-grid-b .ui-block-b,
.my-breakpoint.ui-grid-b .ui-block-c { width: 24.925%; }
}
]]></css>
@@ -139,7 +138,7 @@
<div class="ui-block-b"><div class="ui-body ui-body-d">Block B</div></div>
<div class="ui-block-c"><div class="ui-body ui-body-d">Block C</div></div>
</div>]]></html>

</example>
<category slug="misc"/>
</entry>
@@ -7,7 +7,7 @@
</longdesc>
<added>1.0</added>
<signature>

</signature>
<category slug="events"/>
</entry>
@@ -3,11 +3,11 @@
<title>scrollstop</title>
<desc>Triggers when a scroll finishes. </desc>
<longdesc>

</longdesc>
<added>1.0</added>
<signature>

</signature>
<category slug="events"/>
</entry>

Large diffs are not rendered by default.

Large diffs are not rendered by default.

@@ -14,7 +14,7 @@
<p>The swipe event can also be extend to add your own logic or functionality. The following methods can be extended:</p>
<ul>
<li><code>$.event.special.swipe.start</code> Default:
<pre><code>
<pre><code><![CDATA[
function( event ) {
var data = event.originalEvent.touches ?
event.originalEvent.touches[ 0 ] : event;
@@ -24,11 +24,11 @@ function( event ) {
origin: $( event.target )
};
}
</code></pre>
]]></code></pre>
<p>This method recieves a touchstart event and returns an object of data about the starting location.</p>
</li>
<li><code>$.event.special.swipe.stop</code> Default:
<pre><code>
<pre><code><![CDATA[
function( event ) {
var data = event.originalEvent.touches ?
event.originalEvent.touches[ 0 ] : event;
@@ -37,21 +37,21 @@ function( event ) {
coords: [ data.pageX, data.pageY ]
};
}
</code></pre>
]]></code></pre>
<p>This method recieves a touchend event and returns an object of data about the ending location.</p>
</li>
<li><code>$.event.special.swipe.handleSwipe</code> Default:
<pre><code>
<pre><code><![CDATA[
function( start, stop ) {
if ( stop.time - start.time &lt; $.event.special.swipe.durationThreshold &amp;&amp;
Math.abs( start.coords[ 0 ] - stop.coords[ 0 ] ) &gt; $.event.special.swipe.horizontalDistanceThreshold &amp;&amp;
Math.abs( start.coords[ 1 ] - stop.coords[ 1 ] ) &lt; $.event.special.swipe.verticalDistanceThreshold ) {
if ( stop.time - start.time < $.event.special.swipe.durationThreshold &&
Math.abs( start.coords[ 0 ] - stop.coords[ 0 ] ) > $.event.special.swipe.horizontalDistanceThreshold &&
Math.abs( start.coords[ 1 ] - stop.coords[ 1 ] ) < $.event.special.swipe.verticalDistanceThreshold ) {
start.origin.trigger( "swipe" )
.trigger( start.coords[0] &gt; stop.coords[ 0 ] ? "swipeleft" : "swiperight" );
.trigger( start.coords[0] > stop.coords[ 0 ] ? "swipeleft" : "swiperight" );
}
}
</code></pre>
]]></code></pre>
<p>This method recieves the start and stop objects and handles the logic for and triggering for the swipe events.</p>
</li>
</ul>
@@ -98,13 +98,13 @@ $(function(){
#nav a:hover {
color: #999;
border-color: #999;
background: #eee;
background: #eee;
}
#nav a.selected,
#nav a.selected:hover {
color: #0a0;
border-color: #0a0;
background: #afa;
background: #afa;
}
div.box {
width: 30em;
@@ -119,6 +119,6 @@ $(function(){
<h3>Swipe the green rectangle to change its color:</h3>
<div class="box"></div>
]]></html>
</example>
</example>
<category slug="events"/>
</entry>
@@ -47,13 +47,13 @@ $(function(){
#nav a:hover {
color: #999;
border-color: #999;
background: #eee;
background: #eee;
}
#nav a.selected,
#nav a.selected:hover {
color: #0a0;
border-color: #0a0;
background: #afa;
background: #afa;
}
div.box {
width: 30em;
@@ -68,6 +68,6 @@ $(function(){
<h3>Swipe the green rectangle in the left direction to change its color:</h3>
<div class="box"></div>
]]></html>
</example>
</example>
<category slug="events"/>
</entry>
@@ -15,7 +15,7 @@
$(function(){
// Bind the swiperightHandler callback function to the swipe event on div.box
$( "div.box" ).on( "swiperight", swiperightHandler );
// Callback function references the event target and adds the 'swiperight' class to it
function swiperightHandler( event ){
$( event.target ).addClass( "swiperight" );
@@ -47,13 +47,13 @@ $(function(){
#nav a:hover {
color: #999;
border-color: #999;
background: #eee;
background: #eee;
}
#nav a.selected,
#nav a.selected:hover {
color: #0a0;
border-color: #0a0;
background: #afa;
background: #afa;
}
div.box {
width: 30em;
@@ -68,6 +68,6 @@ $(function(){
<h3>Swipe the green rectangle in the right direction to change its color:</h3>
<div class="box"></div>
]]></html>
</example>
</example>
<category slug="events"/>
</entry>
@@ -5,85 +5,87 @@
<desc>Creates a responsive table in column toggle mode</desc>
<longdesc>
<p>This table mode automatically hides less important columns at narrower widths and surfaces a button to open a menu that allows the user to choose what columns they want to see. In this mode, the author attempts to define which columns are most important to show across various widths by assigning a priority to each column.</p>
<p>A user may choose to check as many columns as they want by tapping the "Columns..." button to open the column

<p>A user may choose to check as many columns as they want by tapping the "Columns..." button to open the column
chooser popup. The popup contains a dynamically generated list of columns based on the table markup that can be checked and unchecked to adjust the visible columns. </p>
<iframe src="/resources/table/example2.html" style="width:100%;height:540px;border:0px"></iframe>

<h3>Applying column chooser mode to a table</h3>

<p>The column chooser mode requires a <code>table</code> element with two attributes: <code>data-role=&quot;table&quot;</code> and <code>data-mode=&quot;columntoggle&quot;</code>. An <code>ID</code> attribute is also required on the table to associate it with the column chooser popup menu.</p>

<pre><code>&lt;table data-role=&quot;table&quot; data-mode=&quot;columntoggle&quot; id=&quot;my-table&quot;&gt;</code></pre>

<pre><code><![CDATA[
<table data-role="table" data-mode="columntoggle" id="my-table">
]]></code></pre>

<h3>How column toggle mode works</h3>

<p>The plugin automates a few key things: it injects the column chooser button, and generates the popup with check list of columns that can be hidden or shown by the user. The list of columns in the chooser menu is populated by parsing the values (or <code>abbr title</code>) of the first row of header (<code>TH</code>) elements. Only headers that have a <code>data-priority</code> attribute are included in the column chooser; headers without this attribute won't made available in the chooser to allow developers to identify critical columns that shouldn't be hidden. If columns are hidden via responsive media queries, these will be unchecked in the chooser to reflect the current column visibility.</p>

<p>The automatic column hiding behavior is accomplished by CSS media queries that hide or show columns based on priority levels at various screen widths. Since each site will have different content and column configurations, we provide a simple media query block that you can copy, paste and customize for each project. This is explained in detail below.</p>

<p>The priorities assigned to headers and media queries used to hide columns act as a sensible default for showing the most important columns that will fit on a device. The column chooser menu gives users the ability to override these defaults and choose which columns they want to see. These user preferences take precedence over the priority mappings so if a column is manually checked, it will remain visible across all screen widths until the page is refreshed. </p>

<p>Because of the flexibility this plugin provides, it's possible for users to introduce horizontal scrolling if the data in each column is long or if many columns are selected to be shown on a smaller screen. </p>

<h3>Setting column priority</h3>

<p>The table works by hiding and showing columns based on two inputs: available screen width or by the user checking and unchecking which columns to display in a column picker popup. Add <code>data-priority</code> attributes to each of the table headers of columns you want to responsively display and assign a priority (1 = highest, 6 = lowest). Any table header given a priority will be available in the column picker menu. </p>
<p>To make a column <em>persistent</em> so it's not available for hiding, omit the <code>data-priority</code> attribute. This will make the column visible at all widths and won't be available in the column chooser menu.</p>

<pre><code>&lt;th&gt;I&#x27;m am critical and can&#x27;t be removed&lt;/th&gt;
&lt;th data-priority=&quot;1&quot;&gt;I&#x27;m very important&lt;/th&gt;
&lt;th data-priority=&quot;3&quot;&gt;I&#x27;m somewhat&lt;/th&gt;
&lt;th data-priority=&quot;5&quot;&gt;I&#x27;m less important&lt;/th&gt;
</code></pre>
<pre><code><![CDATA[
<th>I'm am critical and can't be removed</th>
<th data-priority="1">I'm very important</th>
<th data-priority="3">I'm somewhat</th>
<th data-priority="5">I'm less important</th>
]]></code></pre>


<p>Behind the scenes, the plugin will apply classes to each cell that map to the priority set in the data attribute on the header. For example, if a table heading has a <code>data-priority="3"</code> attribute, every cell in that column will assigned a <code>ui-table-priority-3</code> class once enhanced. These classes are then used in media queries to hide and show columns based on screen width (see below).</p>

<pre><code>&lt;td class=&quot;ui-table-priority-3&quot;&gt;97%&lt;/td&gt;
</code></pre>


<pre><code><![CDATA[
<td class="ui-table-priority-3">97%</td>
]]></code></pre>

<p>You may use any priority naming convention and assign as many (or few) levels of priority for the columns. The plugin simply generates class names based on the values in the <code>data-priority</code> attribute so even though we default to using a numeric system of 1-6, any naming convention is possible. </p>
<p>For example, if a priority of <code>data-priority="critical"</code> is added to the heading, a class of <code>ui-table-priority-critial</code> will be applied to each cell in that column. If a priority is assigned, the column will be made available for the toggling in the column menu and adds the classes to each cell, the rest of the styling and media query creation is up to you write in your custom stylesheet. </p>

<p>For example, if a priority of <code>data-priority="critical"</code> is added to the heading, a class of <code>ui-table-priority-critial</code> will be applied to each cell in that column. If a priority is assigned, the column will be made available for the toggling in the column menu and adds the classes to each cell, the rest of the styling and media query creation is up to you write in your custom stylesheet. </p>

<p>It is important to note that you are required to wrap your table headers in a <code>&lt;thead&gt; ... &lt;/thead&gt;</code> block, and the table body in a <code>&lt;tbody&gt; ... &lt;/tbody&gt;</code> block, as shown in the <a href="#entry-examples">full demo Example</a>.</p>

<h3>Making the table responsive</h3>

<p>The styles for the all priority columns (1-6) start as <code>display:none</code> in the structure stylesheet since we're taking a mobile-first approach to our styles. This means that only columns that should be persistent are visible in the styles to start.</p>

<p>The framework does not automatically include the the media queries to progressively display columns at wider widths. We do this to make it easier for developers to customize the media query widths for each priority level.</p>

<p>Media queries add the responsive behavior to show and hide columns by priority. Each media query is written using <code>min-width</code> widths so they build on top of each other. The widths are set in ems so they respond to font size changes. To calculate a pixel withs in em's, divide the target width by 16 (pixels) - it's that easy.</p>

<p>Inside each media query, we override the <code>display:none</code> style properties set on all the priority columns in the basic styles to <code>display:table-cell</code> so they become visible again and act as a table.</p>

<p>To customize the breakpoints, copy the following style block into your custom style overrides and adjust the <code>min-width</code> media query values for each priority level to specify where various priority columns should appear.</p>

<p>In the example styles below for a <code> my-custom-class</code> class on the table, the priority 1 columns are shown first, at widths above <code>20em</code> (320px), then priority 2 kicks in above <code>30em</code> (480px) and so on up to wide desktop widths with priority 6. Feel free to change these breakpoints in your stylesheet and choose how many priority levels you'd like to use.</p>

<p>In the example styles below for a <code>my-custom-class</code> class on the table, the priority 1 columns are shown first, at widths above <code>20em</code> (320px), then priority 2 kicks in above <code>30em</code> (480px) and so on up to wide desktop widths with priority 6. Feel free to change these breakpoints in your stylesheet and choose how many priority levels you'd like to use.</p>

<pre><code>
/* Show priority 1 at 320px (20em x 16px) */
<pre><code><![CDATA[
/* Show priority 1 at 320px (20em x 16px) */
@media screen and (min-width: 20em) {
.my-custom-class th.ui-table-priority-1,
.my-custom-class td.ui-table-priority-1 {
display: table-cell;
}
}
/* Show priority 2 at 480px (30em x 16px) */
/* Show priority 2 at 480px (30em x 16px) */
@media screen and (min-width: 30em) {
.my-custom-class th.ui-table-priority-2,
.my-custom-class td.ui-table-priority-2 {
display: table-cell;
}
}
...more breakpoints...
</code></pre>
]]></code></pre>
<p>Due to CSS specificity, you will also need to include the class definitions for the hidden and visible states <em>after</em> the custom breakpoints in your custom stylesheet so be sure to include these as well:</p>
<pre><code>
/* Manually hidden */
<pre><code><![CDATA[
/* Manually hidden */
.my-custom-class th.ui-table-cell-hidden,
.my-custom-class td.ui-table-cell-hidden {
display: none;
@@ -94,18 +96,20 @@
.my-custom-class td.ui-table-cell-visible {
display: table-cell;
}
</code></pre>
]]></code></pre>

<h3>Applying a preset breakpoint</h3>

<p>Even though we strongly encourage you to write custom breakpoints yourself, the framework includes a set of pre-configured breakpoints for each of the six priority levels that you can use if they happen work well for your content. </p>

<p>These breakpoints can applied by adding a <code>class="ui-responsive"</code> to the table element. Here is an example of a table with this class added:</p>

<pre><code>&lt;table data-role=&quot;table&quot; class=&quot;ui-responsive&quot; data-mode=&quot;columntoggle&quot; id=&quot;my-table&quot;&gt;</code></pre>
<pre><code><![CDATA[
<table data-role="table" class="ui-responsive" data-mode="columntoggle" id="my-table">
]]></code></pre>

<p>The six preset breakpoints classes included in the column toggle stylesheet use regular increments of 10em (160 pixels). Here is a summary of the breakpoints assigned to each priority in the preset styles: </p>

<dl>
<dt><code>data-priority="1"</code></dt><dd> Displays the column at 320px (20em) </dd>
<dt><code>data-priority="2"</code></dt><dd> Displays the column at 480px (30em) </dd>
@@ -122,23 +126,23 @@
<p>When the column chooser menu opens, the column checkboxes will be checked or unchecked based on the visibility of each column based on the media queries so it accurately reflects what is being seen. These media queries to hide or show columns act as sensible defaults for what columns should be shown based on the developer's understanding of the column importance and data values. The chooser menu allows the user to have control of the table presentation so this takes precedence over the default display.</p>

<p>If an unchecked column checkbox is checked by the user, they now take control of the column. Until the page is refreshed, the visibility of that column will now always be visible, even if the screen is re-sized. Behind the scenes, a class of <code>ui-table-cell-visible</code> is added to all the cells in that column to ensure they override any visibility set via media queries.</p>

<p>The same idea applies when a column is unchecked: from then on, the column won't be seen at any width because the class of <code>ui-table-cell-hidden</code> is added to each of the cells in that column.</p>

<h3>Styling the button and column chooser popup</h3>

<p>The column chooser popup is opened via a button that is generated by the framework. The button's text is "Columns..." by default but can be set by adding the <code>data-column-btn-text</code> attribute to the table to the text string you want in the button. The button will inherit the theme from the content area, just like all buttons, but the theme can be set manually by adding the <code>data-column-btn-theme</code> attribute to any swatch letter in your theme.</p>

<p>This button is injected directly <em>before</em> the table element and has basic styles to align it to the right but you may want to further customize the appearance of this button. To style all these buttons across your site, key off the <code>ui-table-columntoggle-btn</code> structural class on this link. </p>

<p>To target styles against only a specific button, use the unique <code>href</code> value that is generated to target a specific column chooser button. For example, a table with an <code>ID</code> of <code>movie-table</code> will generate a popup with an <code>ID</code> of <code>movie-table-popup</code> so a CSS selector of <code>a[href="#movie-table-popup"]</code> will target only the column popup button for this specific table.</p>

<p>The theme for the column chooser popup can be set by adding the <code>data-column-popup-theme</code> attribute to the table and specifying any swatch letter in your theme. For custom styles or scripting, all the column chooser popups can be targeted by using the <code>ui-table-columntoggle-popup</code> structural class added to these popups. To customize a single popup, use the generated <code>ID</code> based on the table <code>ID</code> that added to each specific popup (such as <code>#movie-table-popup</code>) to target a specific popup.</p>

<h3>Working with grouped column headers</h3>

<p>It's fairly common to need to logically group multiple columns together under a heading group for financial or scientific data. The framework can support the most simple version of this by allowing for two rows of table headers (<code>TH</code>), with the first row containing simple <code>colspan</code> attributes to group the columns below. In this configuration, the framework will parse the first row only for the priority and expose these heading groups as the options in the column chooser popup. In this configuration, the second heading will not be exposed as columns that can be hidden or shown independently of the groupings in the chooser. </p>

</longdesc>
<added>1.3</added>
<options>
@@ -158,7 +162,7 @@
<type name="String" />
</option>
<option name="classes.columnToggleTable" default='"ui-table-columntoggle"'>
<desc>Class assigned to the table.
<desc>Class assigned to the table.
<p>Note: The reflow mode has one option, classes, which is only configurable via JavaScript because it expects an object literal value. The classes option has two properties that define the structural classnames that the plugin uses.</p>
</desc>
<type name="String" />
@@ -183,7 +187,7 @@
</option>
</options>
<events>
<event name="create">
<event name="create">
<desc>Since this plugin is written as an extension to the core table plugin, it binds to the tablecreate event but does not issue any additional events.
</desc>
<argument name="event" type="Event">
@@ -292,7 +296,7 @@
</tr>
</tbody>
</table>
</div>
</div>
]]></html>
@@ -6,38 +6,46 @@
<longdesc>
<p>The reflow table mode works by collapsing the table columns into a stacked presentation that looks like blocks of label/data pairs for each row. Since the HTML source order of a table prohibits styling a table to look like this, the plugin dynamically adds a bit of markup to make the display work (without affecting accessibility). Here is a demo of a basic table using reflow mode:</p>
<iframe src="/resources/table/example1.html" style="width:100%;height:740px;border:0px"></iframe>

<h3>Applying reflow mode to a table</h3>

<p>The reflow responsive table mode is the simplest in terms of markup requirements because it only requires a table with a <code>data-role=&quot;table&quot;</code> on the table element. There is no need to set the <code>data-mode</code> attribute since <code>reflow</code> is the default.</p>

<pre><code>&lt;table data-role=&quot;table&quot; id=&quot;my-table&quot;&gt;</code></pre>

<pre><code><![CDATA[
<table data-role="table" id="my-table">
]]></code></pre>

<h3>How reflow mode works</h3>

<p>The plugin works by parsing the values (or <code>abbr title</code>) of the first row of header (<code>th</code>) elements found in the table. For example, in the table above, the third table header is parsed to grab the contents ("Year"):</p>

<pre><code>&lt;th&gt;Year&lt;/th&gt;</code></pre>
<pre><code><![CDATA[
<th>Year</th>
]]></code></pre>

<p>The script then appends an element with the table header text <em>before</em> the contents of every cell in that column. For example, for every table cell in the year column:</p>

<pre><code>&lt;td&gt;1941&lt;/td&gt;</code></pre>


<pre><code><![CDATA[
<td>1941</td>
]]></code></pre>

<p>An element is added before the text of each cell with a <code>class</code> of <code>ui-table-cell-label</code>:</p>
<pre><code>&lt;td&gt;&lt;b class=&quot;ui-table-cell-label&quot;&gt;Year&lt;/b&gt;1941&lt;/td&gt;</code></pre>

<pre><code><![CDATA[
<td><b class="ui-table-cell-label">Year</b>1941</td>
]]></code></pre>

<p>With our mobile-first approach, the base styles for a reflow table stacks each row and presents each cell in the label/data style format. This is done by hiding the table header rows, making each table cell <code>display:block</code> so they are stacked. The the label element injected into each cell is styled as <code>display:inline-block</code> with a <code>min-width:30%</code> rule to place the labels on the same line as the content at a consistent width to form a two column presentation.</p>

<p>It is important to note that you are required to wrap your table headers in a <code>&lt;thead&gt; ... &lt;/thead&gt;</code> block, and the table body in a <code>&lt;tbody&gt; ... &lt;/tbody&gt;</code> block, as shown in the <a href="#entry-examples">full demo Example</a>.</p>

<h3>Making the table responsive</h3>

<p>By default, a table with reflow mode will display the stacked presentation style on all screen widths. The styles to make the table responsive are added by applying a media query with rules to switch to the tabular style presentation above a specific screen width.</p>
<p>This is done by wrapping a few simple CSS rules in and a media query that only applies the rules above a certain width breakpoint. The styles make the table header rows visible, display the cells in a tabular format, and hide the generated label elements within each. Here is an example media query that swaps the presentation at 40em (640 pixels): </p>
<pre><code>@media ( min-width: 40em ) {
/* Show the table header rows and set all cells to display: table-cell */

<pre><code><![CDATA[
@media ( min-width: 40em ) {
/* Show the table header rows and set all cells to display: table-cell */
.my-custom-breakpoint td,
.my-custom-breakpoint th,
.my-custom-breakpoint tbody th,
@@ -47,18 +55,18 @@
display: table-cell;
margin: 0;
}
/* Hide the labels in each cell */
/* Hide the labels in each cell */
.my-custom-breakpoint td .ui-table-cell-label,
.my-custom-breakpoint th .ui-table-cell-label {
.my-custom-breakpoint th .ui-table-cell-label {
display: none;
}
}
</code></pre>
]]></code></pre>

<p>It's best to use a <code>class</code> on the table to apply the breakpoint. Add these rules to your custom stylesheet that is included in the <code>head</code> of the page. We recommend creating a set of custom breakpoint classes that can be used to apply standard table breakpoints in your project.</p>

<p>In the example above, we're assuming there is a class of <code>my-custom-breakpoint</code> added to the table to apply the breakpoint. Each of the rules in the custom media query are scoped against that table class to target only tables that have the <code>my-custom-breakpoint</code> class.</p>

<p>In order for this technique to work, a browser must support media queries and the ability to style table cells as block-level elements. In testing, most popular desktop and mobile browsers meet these criteria, but older versions of Internet Explorer (8 and older) fall back to a normal table presentation. IE 9 can support this technique but there are a few additional styles needed so we recommend applying these in a <code>max-width</code> media query to only apply them below the table presentation because they are hard to negate. </p>

<h3>Choosing a breakpoint</h3>
@@ -68,11 +76,13 @@

<h3>Applying a preset breakpoint</h3>
<p>Even though we strongly encourage you to write custom breakpoints yourself, the framework includes a single pre-configured breakpoint that targets the stacked style to smaller phones and swaps to a tabular prsentation on larger phones, tablet and desktop devices. To use this preset breakpoint, add the <code>ui-responsive</code> class to the table to convert from the stacked presentation to a tabular presentation at 560px (35em). If this breakpoint doesn't work for your content, we encourage you to write a custom breakpoint as descibed above.</p>

<pre><code>&lt;table data-role=&quot;table&quot; class=&quot;ui-responsive&quot;&gt;</code></pre>


<pre><code><![CDATA[
<table data-role="table" class="ui-responsive">
]]></code></pre>

<h3>Working with grouped column headers</h3>

<p>It's fairly common to need to logically group multiple columns together under a heading group for financial or scientific data. The framework can support the most simple version of this by allowing for two rows of table headers (<code>TH</code>), with the first row containing simple <code>colspan</code> attributes to group the columns below. In this configuration, the framework will add a class to the label of the first cell in each group to allow you to style these differently and provide aditional visual hierarchy. </p>

</longdesc>
@@ -90,17 +100,17 @@
</option>
<option name="initSelector" default='":jqmData(role=&#39;table&#39;)"'>
<desc>This is used to define the selectors (element types, data roles, etc.) that will automatically be initialized as tables. To change which elements are initialized, bind this option to the mobileinit event:
<pre><code>
<pre><code><![CDATA[
$( document ).on( "mobileinit", function() {
$.mobile.table.prototype.options.initSelector = ".mytable";
});
</code></pre>
]]></code></pre>
</desc>
<type name="CSS selector string" />
</option>
</options>
<events>
<event name="create">
<event name="create">
<desc>Since this plugin is written as an extension to the core table plugin, it binds to the tablecreate event but does not issue any additional events.
</desc>
<argument name="event" type="Event">
@@ -17,28 +17,29 @@
<h3>General table markup guidelines</h3>

<p>Here is the basic table markup you should use for both table modes:</p>

<pre><code>&lt;table data-role=&quot;table&quot; id=&quot;my-table&quot; data-mode=&quot;reflow&quot;&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Rank&lt;/th&gt;
&lt;th&gt;Movie Title&lt;/th&gt;
&lt;th&gt;Year&lt;/th&gt;
&lt;th&gt;&lt;abbr title=&quot;Rotten Tomato Rating&quot;&gt;Rating&lt;/abbr&gt;&lt;/th&gt;
&lt;th&gt;Reviews&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;th&gt;1&lt;/th&gt;
&lt;td&gt;&lt;a href=&quot;foo.com&quot; data-rel=&quot;external&quot;&gt;Citizen Kane&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;1941&lt;/td&gt;
&lt;td&gt;100%&lt;/td&gt;
&lt;td&gt;74&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
</code></pre>

<pre><code><![CDATA[
<table data-role="table" id="my-table" data-mode="reflow">
<thead>
<tr>
<th>Rank</th>
<th>Movie Title</th>
<th>Year</th>
<th><abbr title="Rotten Tomato Rating">Rating</abbr></th>
<th>Reviews</th>
</tr>
</thead>
<tbody>
<tr>
<th>1</th>
<td><a href="foo.com" data-rel="external">Citizen Kane</a></td>
<td>1941</td>
<td>100%</td>
<td>74</td>
</tr>
</tbody>
</table>
]]></code></pre>

<p>Both table modes start with standard HTML table markup but there are some specific guidelines you must follow for the responsive table to work correctly: </p>
<ul class="bullet">
@@ -51,25 +52,26 @@
<li>The first row of the table must contain the table headers, be sure to use <code>TH</code> instead of <code>TD</code> tags</li>
<li>To display longer table header text in the column chooser or reflow labels, wrap the text in the <code>TH</code> with a <code>abbr</code> element and set the <code>title</code>. This string will be used in place.</li>
</ul>

<h3>Styling and theming tables</h3>

<p>The responsive table plugin is as minimally styled as possible to give you a clean slate for your designs. The plugin focuses primarily on the difficult scripting elements: generating the labels for the reflow table and creating the button and column chooser popup. Out of the box, the table just has a few basic style rules to add a bit of padding and set the vertical alignment of cells to be top left for visual consistency. </p>
<p>The table will adapt to whatever content block it sits on, but there isn't an explicit theming attribute for this widget. We did this because it's simple enough to add theme classes like <code>ui-body-a</code> to individual cells if a more heavily themed look is wanted.</p>

<h3>Row strokes</h3>
<p>To add horizontal lines between each row, add a custom style to your stylesheet that adds a border to the table headers and cells. In this example, RGBA is used to set a color (black) at an opacity of 5% so this will work on any background color:</p>

<pre><code>.table-stroke thead th {

<pre><code><![CDATA[
.table-stroke thead th {
border-bottom: 1px solid rgba(0, 0, 0, .1);
}
.table-stroke tbody th,
.table-stroke tbody td {
border-bottom: 1px solid rgba(0, 0, 0, .05);
}
</code></pre>
]]></code></pre>
<p>This standard table stroke style can be also applied by adding <code>table-stroke</code> <code>class</code> to the <code>table</code> element. If you prefer a custom stroke style, use the example above as a starting point. Note that adding styles that set a color for the stroke will override a theme class so do not use these together.</p>

</longdesc>
<added>1.3</added>
<options>
@@ -80,17 +82,17 @@
</option>
<option name="initSelector" default='":jqmData(role=&#39;table&#39;)"'>
<desc>This is used to define the selectors (element types, data roles, etc.) that will automatically be initialized as tables. To change which elements are initialized, bind this option to the mobileinit event:
<pre><code>
<pre><code><![CDATA[
$( document ).on( "mobileinit", function() {
$.mobile.table.prototype.options.initSelector = ".mytable";
});
</code></pre>
]]></code></pre>
</desc>
<type name="CSS selector string" />
</option>
</options>
<events>
<event name="create">
<event name="create">
<desc>Triggered when a table is created
</desc>
<argument name="event" type="Event">
@@ -51,13 +51,13 @@ $(function(){
#nav a:hover {
color: #999;
border-color: #999;
background: #eee;
background: #eee;
}
#nav a.selected,
#nav a.selected:hover {
color: #0a0;
border-color: #0a0;
background: #afa;
background: #afa;
}
div.box {
width: 3em;
@@ -3,11 +3,11 @@
<title>taphold</title>
<desc>Triggered after a sustained complete touch event.</desc>
<longdesc>
<p>The jQuery Mobile <code>taphold</code> event triggers after a sustained, complete touch event (also known as a long press).</p>
<p>The jQuery Mobile <code>taphold</code> event triggers after a sustained, complete touch event (also known as a long press).</p>

<p><code>$.event.special.tap.tapholdThreshold</code> (default: 750) - This value dictates how long the user must hold their tap before the taphold event is fired on the target element.</p>

<xi:include href="../includes/core-extension-desc.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
<xi:include href="../includes/core-extension-desc.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
</longdesc>
<added>1.0</added>
<signature>
@@ -52,13 +52,13 @@ $(function(){
#nav a:hover {
color: #999;
border-color: #999;
background: #eee;
background: #eee;
}
#nav a.selected,
#nav a.selected:hover {
color: #0a0;
border-color: #0a0;
background: #afa;
background: #afa;
}
div.box {
width: 3em;
@@ -5,154 +5,154 @@
<desc>Creates a textinput widget for textinput, textarea or search input</desc>
<longdesc>
<h2>Text Input</h2>

<p>Text inputs and textareas are coded with standard HTML elements, then enhanced by jQuery Mobile to make them more attractive and useable on a mobile device. View the <a href="../data-attribute/">data- attribute reference</a> to see all the possible attributes you can add to text inputs.</p>

<p>To collect standard alphanumeric text, use an <code>input</code> with a <code>type="text"</code> attribute. Set the <code>for</code> attribute of the <code>label</code> to match the <code>id</code> of the <code>input</code> so they are semantically associated. It's possible to accessibly hide the label if it's not desired in the page layout, but we require that it is present in the markup for semantic and accessibility reasons.</p>

<pre><code>
&lt;label for=&quot;basic&quot;&gt;Text Input:&lt;/label&gt;
&lt;input type=&quot;text&quot; name=&quot;name&quot; id=&quot;basic&quot; value=&quot;&quot; /&gt;
</code></pre>
<pre><code><![CDATA[
<label for="basic">Text Input:</label>
<input type="text" name="name" id="basic" value="" />
]]></code></pre>
<p>This will produce a basic text input. The default styles set the width of the input to 100% of the parent container and stack the label on a separate line.
<iframe src="/resources/textinput/example1.html" style="width:100%;height:90px;border:0px"></iframe></p>

<h3>Mini version</h3>

<p>For a more compact version that is useful in toolbars and tight spaces, add the <code>data-mini="true"</code> attribute to the element to create a mini version.</p>
<pre><code>
&lt;label for=&quot;basic&quot;&gt;Text Input:&lt;/label&gt;
&lt;input type=&quot;text&quot; name=&quot;name&quot; id=&quot;basic&quot; value=&quot;&quot; data-mini=&quot;true&quot; /&gt;
</code></pre>

<pre><code><![CDATA[
<label for="basic">Text Input:</label>
<input type="text" name="name" id="basic" value="" data-mini="true" />
]]></code></pre>

<p>This will produce an input that is not as tall as the standard version and has a smaller text size.
<iframe src="/resources/textinput/example2.html" style="width:100%;height:90px;border:0px"></iframe></p>

<h3>Clear button option</h3>

<p>To add a clear button to any input (like the search input), add the <code>data-clear-btn="true"</code> attribute. The text for this clear button can be customized via the <code>data-clear-btn-text="clear input"</code> attribute. Search buttons have the clear button by default and cannot be controlled by this option. Note that this is available for all the input types below except for <code>textareas</code>.</p>

<pre><code>
&lt;label for=&quot;clear-demo&quot;&gt;Text Input:&lt;/label&gt;
&lt;input type=&quot;text&quot; name=&quot;clear&quot; id=&quot;clear-demo&quot; value=&quot;&quot; data-clear-btn=&quot;true&quot; /&gt;
</code></pre>
<pre><code><![CDATA[
<label for="clear-demo">Text Input:</label>
<input type="text" name="clear" id="clear-demo" value="" data-clear-btn="true" />
]]></code></pre>

<p>This markup creates a text input with a clear button that becomes visible as soon as a character has been entered.
<iframe src="/resources/textinput/example7.html" style="width:100%;height:90px;border:0px"></iframe></p>

<h3>Field containers</h3>
<p>Optionally wrap the text input in a container with the <code> data-role="fieldcontain"</code> attribute to help visually group it in a longer form.</p>
<pre><code>
&lt;div data-role=&quot;fieldcontain&quot;&gt;
&lt;label for=&quot;name&quot;&gt;Text Input:&lt;/label&gt;
&lt;input type=&quot;text&quot; name=&quot;name&quot; id=&quot;name&quot; value=&quot;&quot; /&gt;
&lt;/div&gt;
</code></pre>

<p>Optionally wrap the text input in a container with the <code>data-role="fieldcontain"</code> attribute to help visually group it in a longer form.</p>
<pre><code><![CDATA[
<div data-role="fieldcontain">
<label for="name">Text Input:</label>
<input type="text" name="name" id="name" value="" />
</div>
]]></code></pre>

<p>The text input is now displayed like this:
<iframe src="/resources/textinput/example3.html" style="width:100%;height:90px;border:0px"></iframe></p>

<h3>More text input types</h3>
<p>In jQuery Mobile, you can use existing and new HTML5 input types such as <code>password</code>, <code>email</code>, <code>tel</code>, <code>number</code>, and more. Some type values are rendered differently across browsers. For example, Chrome renders the <code>range</code> input as a slider. jQuery Mobile standardizes the appearance of <code>range</code> and <code>search</code> by dynamically changing their type to <code>text</code>. You can configure which input types are degraded to <code>text</code> with the <code>page</code> plugin's options.</p>

<p>One major advantage of using these more specific input types if that on mobile devices, specialized keyboards that speed data entry are offered in place of the standard text keyboard. Try the following inputs on a mobile device to see which display custom keyboards on various platforms.
<iframe src="/resources/textinput/example4.html" style="width:100%;height:710px;border:0px"></iframe></p>

<h2>Textareas</h2>

<p>For multi-line text inputs, use a <code>textarea</code> element. The framework will auto-grow the height of the textarea to avoid the need for an internal scrollbar. </p>
<p>Set the <code>for</code> attribute of the <code>label</code> to match the <code>id</code> of the <code>textarea</code> so they are semantically associated, and wrap them in a <code>div</code> with the <code> data-role="fieldcontain"</code> attribute to group them.</p>
<p>Set the <code>for</code> attribute of the <code>label</code> to match the <code>id</code> of the <code>textarea</code> so they are semantically associated, and wrap them in a <code>div</code> with the <code>data-role="fieldcontain"</code> attribute to group them.</p>

<pre><code>
&lt;label for=&quot;textarea-a&quot;&gt;Textarea:&lt;/label&gt;
&lt;textarea name=&quot;textarea&quot; id=&quot;textarea-a&quot;&gt;
I&#x27;m a basic textarea. If this is pre-populated with content, the height will be automatically adjusted to fit without needing to scroll. That is a pretty handy usability feature.
&lt;/textarea&gt;
</code></pre>
<pre><code><![CDATA[
<label for="textarea-a">Textarea:</label>
<textarea name="textarea" id="textarea-a">
I'm a basic textarea. If this is pre-populated with content, the height will be automatically adjusted to fit without needing to scroll. That is a pretty handy usability feature.
</textarea>
]]></code></pre>

<p>This will produce a basic textarea with the width set to 100% of the parent container and the label stacked on a separate line. The textarea will grow to fit new lines as you type:
<iframe src="/resources/textinput/example5.html" style="width:100%;height:190px;border:0px"></iframe></p>
<pre><code>
&lt;div data-role=&quot;fieldcontain&quot;&gt;
&lt;label for=&quot;textarea&quot;&gt;Textarea:&lt;/label&gt;
&lt;textarea name=&quot;textarea&quot; id=&quot;textarea&quot;&gt;&lt;/textarea&gt;
&lt;/div&gt;
</code></pre>

<pre><code><![CDATA[
<div data-role="fieldcontain">
<label for="textarea">Textarea:</label>
<textarea name="textarea" id="textarea"></textarea>
</div>
]]></code></pre>

<p>The textarea is displayed like this and will grow to fit new lines as you type:
<iframe src="/resources/textinput/example6.html" style="width:100%;height:190px;border:0px"></iframe></p>

<h3>Calling the textinput plugin</h3>

<p>This plugin will auto initialize on any page that contains a textarea or any of the text input types listed above without any need for a <code>data-role</code> attribute in the markup. However, if needed, you can directly call the <code>textinput</code> plugin on any selector, just like any jQuery plugin:</p>
<pre><code>
$( "input" ).textinput();
</code></pre>
<pre><code><![CDATA[
$( "input" ).textinput();
]]></code></pre>

<h3>Degraded input types</h3>

<p>jQuery Mobile degrades several HTML5 input types back to type=text or type=number after adding enhanced controls. For example, inputs with a type of range are enhanced with a custom slider control, and their type is set to number to offer a usable form input alongside that slider. Inputs with a type of search are degraded back to type=text after we add our own themeable search input styling.</p>
<p>The page plugin contains a list of input types that are set to either true which means they'll degrade to type=text, false which means they'll be left alone, or a string such as "number", which means they'll be converted to that type (such as the case of type=range).</p>
<p>You can configure which types are changed via the page plugin's <code>degradeInputs</code> option, which can be manipulated externally via <code>$.mobile.page.prototype.options.degradeInputs</code>, which has properties: color, date, datetime, "datetime-local", email, month, number, range, search, tel, time, url, and week. Be sure to configure this inside an event handler bound to the <code>mobileinit</code> event, so that it applies to the first page as well as subsequent pages that are loaded.</p>

<p>You can configure which types are changed via the page plugin's <code>degradeInputs</code> option, which can be manipulated externally via <code>$.mobile.page.prototype.options.degradeInputs</code>, which has properties: color, date, datetime, "datetime-local", email, month, number, range, search, tel, time, url, and week. Be sure to configure this inside an event handler bound to the <code>mobileinit</code> event, so that it applies to the first page as well as subsequent pages that are loaded.</p>

<h2>Search Input</h2>
<p>Search inputs are a new HTML type that is styled with pill-shaped corners and adds an "x" icon to clear the field once you start typing. Start with an input with a type="search" attribute in your markup.</p>
<p>Set the <code>for</code> attribute of the <code>label</code> to match the <code>id</code> of the <code>input</code> so they are semantically associated. It's possible to accessibly hide the label if it's not desired in the page layout, but we require that it is present in the markup for semantic and accessibility reasons.</p>

<pre><code>
&lt;label for="search-basic"&gt;Search Input:&lt;/label&gt;
&lt;input type="search" name="search" id="search-basic" value="" /&gt;
</code></pre>
<pre><code><![CDATA[
<label for="search-basic">Search Input:</label>
<input type="search" name="search" id="search-basic" value="" />
]]></code></pre>
<p>This will produce a basic search input. The default styles set the width of the input to 100% of the parent container and stack the label on a separate line.
<iframe src="/resources/search-input/example1.html" style="width:100%;height:90px;border:0px"></iframe></p>

<h3>Mini version</h3>

<p>For a more compact version that is useful in toolbars and tight spaces, add the <code>data-mini="true"</code> attribute to the element to create a mini version.</p>
<pre><code>
&lt;label for=&quot;search-mini&quot;&gt;Search Input:&lt;/label&gt;
&lt;input type=&quot;search&quot; name=&quot;search-mini&quot; id=&quot;search-mini&quot; value=&quot;&quot; data-mini=&quot;true&quot;/&gt;
</code></pre>

<pre><code><![CDATA[
<label for="search-mini">Search Input:</label>
<input type="search" name="search-mini" id="search-mini" value="" data-mini="true"/>
]]></code></pre>

<p>This will produce a search input that is not as tall as the standard version and has a smaller text size.
<iframe src="/resources/search-input/example2.html" style="width:100%;height:90px;border:0px"></iframe></p>

<h3>Field containers</h3>

<p>Optionally wrap the search input in a container with the <code>data-role="fieldcontain"</code> attribute to help visually group it in a longer form.</p>
<pre><code>
&lt;div data-role=&quot;fieldcontain&quot;&gt;
&lt;label for=&quot;search-2&quot;&gt;Search Input:&lt;/label&gt;
&lt;input type=&quot;search&quot; name=&quot;search-2&quot; id=&quot;search-2&quot; value=&quot;&quot; /&gt;
&lt;/div&gt;
</code></pre>
<pre><code><![CDATA[
<div data-role="fieldcontain">
<label for="search-2">Search Input:</label>
<input type="search" name="search-2" id="search-2" value="" />
</div>
]]></code></pre>

<p>The search input is now displayed like this:
<iframe src="/resources/search-input/example3.html" style="width:100%;height:90px;border:0px"></iframe>
</p>

<h3>Theming</h3>
<p>The <code>data-theme</code> attribute can be added to the search input to set the theme to any swatch letter.
<iframe src="/resources/search-input/example4.html" style="width:100%;height:90px;border:0px"></iframe>
</p>

<h3>Setting the clear button text</h3>
<p>The text for the button used to clear the search input of text can be configured for all search inputs by binding to the <code>mobileinit</code> event and setting the

<p>The text for the button used to clear the search input of text can be configured for all search inputs by binding to the <code>mobileinit</code> event and setting the
<code>$.mobile.textinput.prototype.options.clearSearchButtonText</code> property to a string of your choosing.</p>

<h3>Calling the textinput plugin</h3>

<p>This plugin will auto-initialize on any page that contains a text input with the <code>type="search"</code> attribute without any need for a <code>data-role</code> attribute in the markup. However, if needed, you can directly call the <code>textinput</code> plugin on a selector, just like any jQuery plugin:</p>
<pre><code>
$( ".mySearchInput" ).textinput();
</code></pre>

<pre><code><![CDATA[
$( ".mySearchInput" ).textinput();
]]></code></pre>

</longdesc>
<added>1.0</added>
@@ -176,16 +176,16 @@ $( ".mySearchInput" ).textinput();
</option>
<option name="initSelector" default="input[type='text'], input[type='search'], :jqmData(type='search'), input[type='number'], :jqmData(type='number'), input[type='password'], input[type='email'], input[type='url'], input[type='tel'], textarea, input:not([type])">
<desc>This is used to define the selectors (element types, data roles, etc.) that will automatically be initialized as textinputs. To change which elements are initialized, bind this option to the mobileinit event:
<pre><code>
<pre><code><![CDATA[
$( document ).on( "mobileinit", function() {
$.mobile.textinput.prototype.options.initSelector = ".myInputs";
});
</code></pre>
});
]]></code></pre>
</desc>
<type name="CSS selector string" />
</option>
<option name="mini" default="false" example-value="true">
<desc>Sets the size of the element to a more compact, mini version.
<desc>Sets the size of the element to a more compact, mini version.
<p>This option is also exposed as a data attribute: <code>data-mini="true"</code>.</p>
</desc>
<type name="Boolean" />
@@ -7,15 +7,15 @@
<p>The <code>throttledresize</code> event is triggered if orientationchange is not natively supported.</p>
<p>This event triggers when the browser window resizes from:</p>
<ol>
<li>an orientation change (orientation-enabled device);</li>
<li>an orientation change (orientation-enabled device);</li>
<li>changes in dimension ratio that replicates a landspace/portrait change (resizing a desktop browser).</li>
</ol>

<xi:include href="../includes/core-extension-desc.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
<pre><code><![CDATA[
var count = 0;
$(function() {
// Bind an event handler to window throttledresize event that, when triggered,
// Bind an event handler to window throttledresize event that, when triggered,
// passes a reference of itself that is accessible by the callback function.
$( window ).on( "throttledresize", throttledresizeHandler );
@@ -25,11 +25,11 @@ $(function() {
// You can also manually force this event to fire.
$( window ).trigger( "throttledresize" );
});
});
]]></code></pre>
<p>Visit this from your orientation-enabled device to see it in action!
<iframe id="throttledresizeIframe" src="/resources/throttledresize/example1.html" style="width:100%;height:90px;border:0px"></iframe></p>

</longdesc>
<added>1.0</added>
<signature>
@@ -6,12 +6,14 @@
<p>Some components within the framework, such as collapsible and listview search, dynamically hide and show content based on user events. This hiding/showing of content affects the size of the page and may result in the browser adjusting/scrolling the viewport to accommodate the new page size. Since this has the potential to affect other components such as fixed headers and footers, components like collapsible and listview trigger a custom <code>updatelayout</code> event to notify other components that they may need to adjust their layouts in response to their content changes. Developers who are building dynamic applications that inject, hide, or remove content from the page, or manipulate it in any way that affects the dimensions of the page, can also manually trigger this <code>updatelayout</code> event to ensure components on the page update in response to the changes.</p>
<p>This event is triggered by components within the framework that dynamically show/hide content, and is meant as a generic mechanism to notify other components that they may need to update their size or position. Within the framework, this event is fired on the component element whose content was shown/hidden, and bubbles all the way up to the document element. </p>

<pre><code>$( "#foo" ).hide().trigger( "updatelayout" );</code></pre>

<pre><code><![CDATA[
$( "#foo" ).hide().trigger( "updatelayout" );
]]></code></pre>

</longdesc>
<added>1.0</added>
<signature>

</signature>
<category slug="events"/>
</entry>
@@ -7,7 +7,7 @@
<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>
<p>The jQuery Mobile <code>"vclick"</code> event handler simulates the "onclick" event handler on mobile devices.</p>
<xi:include href="../includes/core-extension-desc.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>

<pre><code><![CDATA[
$( document ).on( "vclick", "p", function() {
$( this ).append( "<span style='color:#108040;'> vclick fired... </span>" );
@@ -17,15 +17,15 @@ $( document ).on( "vclick", "p", function() {
<p>
<iframe src="/resources/vclick/example1.html" style="width:100%;height:90px;border:0px"></iframe>
</p>

<div class="warning"><h4>Warning: Use vclick with caution</h4>
<p> Use vclick with caution on touch devices. Webkit based browsers synthesize <code>mousedown</code>, <code>mouseup</code>, and <code>click</code> events roughly 300ms after the <code>touchend</code> event is dispatched. The target of the synthesized mouse events are calculated at the time they are dispatched and are based on the location of the touch events and, in some cases, the implementation specific heuristics which leads to different target calculations on different devices and even different OS versions for the same device. This means the target element within the original touch events could be different from the target element within the synthesized mouse events.</p>
<p>We recommend using <code>click</code> instead of <code>vclick</code> anytime the action being triggered has the possibility of changing the content underneath the point that was touched on screen. This includes page transitions and other behaviors such as collapse/expand that could result in the screen shifting or content being completely replaced.</p>
</div>
<div class="warning"><h4>Canceling an element's default click behavior</h4>
<p>Applications can call <code>preventDefault()</code> on a <code>vclick</code> event to cancel an element's default click behavior. On mouse based devices, calling <code>preventDefault()</code> on a <code>vclick</code> event equates to calling <code>preventDefault()</code> on the real <code>click</code> event during the bubble event phase. On touch based devices, it's a bit more complicated since the actual <code>click</code> event is dispatched about 300ms after the <code>vclick</code> event is dispatched. For touch devices, calling <code>preventDefault()</code> on a <code>vclick</code> event triggers some code in the vmouse plugin that attempts to catch the next <code>click</code> event that gets dispatched by the browser, during the capture event phase, and calls <code>preventDefault()</code> and <code>stopPropagation()</code> on it. As mentioned in the warning above, it is sometimes difficult to match up a touch event with its corresponding mouse event because the targets can differ. For this reason, the vmouse plugin also falls back to attempting to identify a corresponding <code>click</code> event by coordinates. There are still cases where both target and coordinate identification fail, which results in the <code>click</code> event being dispatched and either triggering the default action of the element, or in the case where content has been shifted or replaced, triggering a click on a different element. If this happens on a regular basis for a given element/control, we suggest you use <code>click</code> for triggering your action.</p>
</div>

<dd><p>The virtual mouse events can also be configured:</p>
<ul>
<li><code>$.vmouse.moveDistanceThreshold</code> (default: 10px) – More than this, then it is a scroll event. The vmousecancel event is called and the TouchMove event is cancelled.</li>
@@ -7,7 +7,7 @@
<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>
<p>The jQuery Mobile <code>vmousecancel</code> event handler is called whenever the system cancels a virtualized mouse event. This event occurs when a scroll is triggered. jQuery Mobile will fire a "vmousecancel" event in this instance.</p>
<xi:include href="../includes/core-extension-desc.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>

<dd><p>The virtual mouse events can also be configured:</p>
<ul>
<li><code>$.vmouse.moveDistanceThreshold</code> (default: 10px) – More than this, then it is a scroll event. The vmousecancel event is called and the TouchMove event is cancelled.</li>
@@ -5,9 +5,9 @@
<longdesc>
<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>
<p>The jQuery Mobile <code>vmousedown</code> event handler simulates the "onmousedown" event handler on mobile devices.</p>

<xi:include href="../includes/core-extension-desc.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>

<pre><code><![CDATA[
$( function () {
$( document ).on( "vmousedown", "p", function() {
@@ -5,9 +5,9 @@
<longdesc>
<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>
<p>The jQuery Mobile <code>vmousemove</code> event handler simulates the "onmousemove" event handler on mobile devices.</p>

<xi:include href="../includes/core-extension-desc.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>

<pre><code><![CDATA[
$( function () {
$( document ).on ( "vmousemove", "#target", function(event) {
@@ -17,7 +17,7 @@ $( document ).on( "vmouseout", "p", function() {
<p>
<iframe src="/resources/vmouseout/example1.html" style="width:100%;height:90px;border:0px"></iframe>
</p>

<dd><p>The virtual mouse events can also be configured:</p>
<ul>
<li><code>$.vmouse.moveDistanceThreshold</code> (default: 10px) – More than this, then it is a scroll event. The vmousecancel event is called and the TouchMove event is cancelled.</li>
@@ -31,7 +31,7 @@ $( document ).on( "vmouseout", "p", function() {
<argument name="preventDefault" type="Function" optional="true">
<desc>A function to invoke in the event binding to prevent the synthetic click event by the browser.</desc>
</argument>

</signature>
<category slug="events"/>
</entry>
@@ -6,9 +6,9 @@
<longdesc>
<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>
<p>The jQuery Mobile <code>"vmouseover"</code> event handler simulates the "onmouseover" event handler on mobile devices.</p>

<xi:include href="../includes/core-extension-desc.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>

<pre><code><![CDATA[
$( document ).on( "vmouseover", "p", function() {
$( this ).append( "<span style='color:#108040;'> vmouseover fired...</span>" );
@@ -18,7 +18,7 @@ $( document ).on( "vmouseover", "p", function() {
<p>
<iframe src="/resources/vmouseover/example1.html" style="width:100%;height:90px;border:0px"></iframe>
</p>

<dd><p>The virtual mouse events can also be configured:</p>
<ul>
<li><code>$.vmouse.moveDistanceThreshold</code> (default: 10px) – More than this, then it is a scroll event. The vmousecancel event is called and the TouchMove event is cancelled.</li>
@@ -7,7 +7,7 @@
<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>
<p>The jQuery Mobile <code>"vmouseup"</code> event handler simulates the "onmouseup" event handler on mobile devices.</p>
<xi:include href="../includes/core-extension-desc.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>

<pre><code><![CDATA[
$( document ).on( "vmouseup", "p", function() {
$( this ).append( "<span style='color:#108040;'> vmouseup fired...</span>" );
@@ -17,7 +17,7 @@ $( document ).on( "vmouseup", "p", function() {
<p>
<iframe src="/resources/vmouseup/example1.html" style="width:100%;height:90px;border:0px"></iframe>
</p>

<dd><p>The virtual mouse events can also be configured:</p>
<ul>
<li><code>$.vmouse.moveDistanceThreshold</code> (default: 10px) – More than this, then it is a scroll event. The vmousecancel event is called and the TouchMove event is cancelled.</li>
@@ -570,7 +570,7 @@ <h2><a href="../checkboxradio/">Radio button</a></h2>
</table>
<p>Multiple radion buttons can be wrapped in a container with a <code>data-role="controlgroup"</code> attribute for a vertically grouped set. Add the <code>data-type="horizontal"</code> attribute for the radio buttons to sit side-by-side. Add the <code>data-mini="true"</code> to get the mini/compact sized version for all the radio buttons that appear in the controlgroup. </p>

<h2><a href="../select/">Select</a></h2>
<h2><a href="../selectmenu/">Selectmenu</a></h2>
<p>All <code>select</code> form elements are auto-enhanced, no <code>data-role</code> required</p>
<table class="column-headers">
<tr>
@@ -642,7 +642,7 @@ <h2><a href="../slider/">Slider</a></h2>
</table>
<p></p>

<h2><a href="../textinput/">Text input &amp; Textarea</a></h2>
<h2><a href="../textinput/">Textinput</a></h2>
<p>Input <code>type="text|number|search|etc."</code> or <code>textarea</code> elements are auto-enhanced, no <code>data-role</code> required</p>
<table class="column-headers">
<tr>
@@ -58,73 +58,73 @@ <h2>Configurable options</h2>
<p>The following defaults are configurable via the <code>$.mobile</code> object:</p>

<dl>
<dt><code>activeBtnClass</code> <em>string</em>, default: "ui-btn-active"</dt>
<dt id="activeBtnClass"><code>activeBtnClass</code> <em>string</em>, default: "ui-btn-active"</dt>
<dd>The CSS class used for "active" button state.</dd>
<br />
<dt><code>activePageClass</code> <em>string</em>, default: "ui-page-active"</dt>
<dt id="activePageClass"><code>activePageClass</code> <em>string</em>, default: "ui-page-active"</dt>
<dd>The CSS class used for the page currently in view or in a transition.</dd>
<br />
<dt><code>ajaxEnabled</code> <em>boolean</em>, default: true</dt>
<dt id="ajaxEnabled"><code>ajaxEnabled</code> <em>boolean</em>, default: true</dt>
<dd>jQuery Mobile will automatically handle link clicks and form submissions through Ajax, when possible. If false, URL hash listening will be disabled as well, and URLs will load as ordinary HTTP requests.</dd>
<br />
<dt><code>allowCrossDomainPages</code> <em>boolean</em>, default: false</dt>
<dt id="allowCrossDomainPages"><code>allowCrossDomainPages</code> <em>boolean</em>, default: false</dt>
<dd>When jQuery Mobile attempts to load an external page, the request runs through <code>$.mobile.loadPage()</code>. This will only allow cross-domain requests if <code>$.mobile.allowCrossDomainPages</code> is set to true. Because the jQuery Mobile framework tracks what page is being viewed within the browser's location hash, it is possible for a cross-site scripting (XSS) attack to occur if the XSS code in question can manipulate the hash and set it to a cross-domain URL of its choice. This is the main reason that the default setting for $.mobile.allowCrossDomainPages is set to false. In PhoneGap apps that must "phone home" by loading assets off a remote server, both the <code>$.support.cors</code> AND <code>$.mobile.allowCrossDomainPages</code> must be set to true.</dd>
<br />
<dt><code>autoInitializePage</code> <em>boolean</em>, default: true</dt>
<dt id="autoInitializePage"><code>autoInitializePage</code> <em>boolean</em>, default: true</dt>
<dd>When the DOM is ready, the framework should automatically call <code>$.mobile.initializePage</code>. If false, the page will not initialize and will be visually hidden until <code>$.mobile.initializePage</code> is manually called.</dd>
<br />
<dt><code>buttonMarkup.hoverDelay</code> <em>integer</em>, default: 200</dt>
<dt id="buttonMarkup.hoverDelay"><code>buttonMarkup.hoverDelay</code> <em>integer</em>, default: 200</dt>
<dd>Set the delay for touch devices to add the hover and down classes on touch interactions for buttons throughout the framework. Reducing the delay here results in a more responsive feeling ui, but will often result in the downstate being applied during page scrolling.</dd>
<br />
<dt><code>defaultDialogTransition</code> <em>string</em>, default: 'pop'</dt>
<dt id="defaultDialogTransition"><code>defaultDialogTransition</code> <em>string</em>, default: 'pop'</dt>
<dd>Set the default transition for dialog changes that use Ajax. Set to 'none' for no transitions.</dd>
<br />
<dt><code>defaultPageTransition</code> <em>string</em>, default: 'fade'</dt>
<dt id="defaultPageTransition"><code>defaultPageTransition</code> <em>string</em>, default: 'fade'</dt>
<dd>Set the default transition for page changes that use Ajax. Note: default changed from 'slide' to 'fade' in 1.1. Set to 'none' for no transitions.</dd>
<br />
<dt><code>dynamicBaseEnabled</code> <em>boolean</em>, default: true</dt>
<dt id="dynamicBaseEnabled"><code>dynamicBaseEnabled</code> <em>boolean</em>, default: true</dt>
<dd>When this property is set to <code>false</code> the base tag value in browsers that support a dynamic base tag and URL prefixes in browsers that don't <em>won't</em> be updated to reflect where the page was loaded from. This means that resource references that are relative to the page on which they are defined may break. This option is available for web frameworks that operate under a universal base tag value where all links and assets are relative to a signal base.</dd>
<br />
<dt><code>getMaxScrollForTransition</code> <em>integer</em>, default: 3</dt>
<dt id="getMaxScrollForTransition"><code>getMaxScrollForTransition</code> <em>integer</em>, default: 3</dt>
<dd>Set a scroll position breakpoint for transitions. If the scroll position is greater than the window height multiplied by the value that has been set, transition "none" will be used.</dd>
<br />
<dt><code>gradeA</code> <em>function that returns a boolean</em>, default: a function returning the value of $.support.mediaquery</dt>
<dt id="gradeA"><code>gradeA</code> <em>function that returns a boolean</em>, default: a function returning the value of $.support.mediaquery</dt>
<dd>Any support conditions that must be met in order to proceed.</dd>
<br />
<dt><code>hashListeningEnabled</code> <em>boolean</em>, default: true</dt>
<dt id="hashListeningEnabled"><code>hashListeningEnabled</code> <em>boolean</em>, default: true</dt>
<dd>jQuery Mobile will automatically listen and handle changes to the location.hash. Disabling this will prevent jQuery Mobile from handling hash changes, which allows you to handle them yourself or use simple deep-links within a document that scroll to a particular id.</dd>
<br />
<dt><code>ignoreContentEnabled</code> <em>boolean</em>, default: false</dt>
<dt id="ignoreContentEnabled"><code>ignoreContentEnabled</code> <em>boolean</em>, default: false</dt>
<dd><em>Warning:</em> Setting this property to true will cause performance degradation on enhancement. Once set, all automatic enhancements made by the framework to each enhanceable element of the user's markup will first check for a <code>data-enhance=false</code> parent node. If one is found the markup will be ignored. This setting and the accompanying data attribute provide a mechanism through which users can prevent enhancement over large sections of markup.</dd>
<br />
<dt><code>linkBindingEnabled</code> <em>boolean</em>, default: true</dt>
<dt id="linkBindingEnabled"><code>linkBindingEnabled</code> <em>boolean</em>, default: true</dt>
<dd>jQuery Mobile will automatically bind the clicks on anchor tags in your document. Setting this option to false will prevent all anchor click handling <em>including</em> the addition of active button state and alternate link bluring. This should only be used when attempting to delegate the click management to another library or custom code.</dd>
<br />
<dt><code>loadingMessage</code> <em>string</em>, default: "loading"</dt>
<dt id="loadingMessage"><code>loadingMessage</code> <em>string</em>, default: "loading"</dt>
<dd>
Set the text that appears when a page is loading. If set to false, the message will not appear at all.
<div class="warning"><strong>Deprecated</strong> in 1.2 - use <code>$.mobile.loader.prototype.options.text</code> instead. See the <a href="page-loading">loader docs</a> for more.</div>
</dd>

<dt><code>loadingMessageTextVisible</code> <em>boolean</em>, default: false</dt>
<dt id="loadingMessageTextVisible"><code>loadingMessageTextVisible</code> <em>boolean</em>, default: false</dt>
<dd>
Whether the text should be visible when a loading message is shown. The text is always visible for loading errors.
<div class="warning"><strong>Deprecated</strong> in 1.2 - use <code>$.mobile.loader.prototype.options.textVisible</code> instead. See the <a href="page-loading">loader docs</a> for more.</div>
</dd>

<dt><code>loadingMessageTheme</code> <em>string</em>, default: "a"</dt>
<dt id="loadingMessageTheme"><code>loadingMessageTheme</code> <em>string</em>, default: "a"</dt>
<dd>
The theme that the loading message box uses when text is visible.
<div class="warning"><strong>Deprecated</strong> in 1.2 - use <code>$.mobile.loader.prototype.options.theme</code> instead. See the <a href="page-loading">loader docs</a> for more.</div>
</dd>

<dt><code>maxTransitionWidth</code> <em>integer, boolean</em>, default: false</dt>
<dt id="maxTransitionWidth"><code>maxTransitionWidth</code> <em>integer, boolean</em>, default: false</dt>
<dd>Set a max width for transitions. The option accepts any number representing a pixel width and its default value <code>false</code>. If a number value is set, transition "none" will be used if the window is wider than the specified value.</dd>
<br />
<dt><code>minScrollBack</code> <em>integer</em>, default: 250</dt>
<dt id="minScrollBack"><code>minScrollBack</code> <em>integer</em>, default: 250</dt>
<dd>Minimum scroll distance that will be remembered when returning to a page.</dd>
<br />
<dt><code>ns</code> <em>string</em>, default: ""</dt>
<dt id="ns"><code>ns</code> <em>string</em>, default: ""</dt>
<dd>The namespace used in data attributes (e.g., data-role). Can be set to any string, including a blank string which is the default. When using, it's clearest if you include a trailing dash, such as "mynamespace-" which maps to <code>data-mynamespace-foo="..."</code>.
<p>If you use data- namespacing, you will need to update/override one selector in the theme CSS. The following data selectors should incorporate the namespace you're using:
<pre><code>
@@ -133,28 +133,22 @@ <h2>Configurable options</h2>
</p>
</dd>
<br />
<dt><code>pageLoadErrorMessage</code> <em>string</em>, default: "Error Loading Page"</dt>
<dt id="pageLoadErrorMessage"><code>pageLoadErrorMessage</code> <em>string</em>, default: "Error Loading Page"</dt>
<dd>Set the text that appears when a page fails to load through Ajax.</dd>
<br />
<dt><code>pageLoadErrorMessageTheme</code> <em>string</em>, default: "e"</dt>
<dt id="pageLoadErrorMessageTheme"><code>pageLoadErrorMessageTheme</code> <em>string</em>, default: "e"</dt>
<dd>Set the theme that the error message box uses.</dd>
<br />
<dt><code>phonegapNavigationEnabled</code> <em>boolean</em>, default: false</dt>
<dt id="phonegapNavigationEnabled"><code>phonegapNavigationEnabled</code> <em>boolean</em>, default: false</dt>
<dd>Replace calls to <code>window.history.back</code> with PhoneGap's navigation helper where it is available. This addresses navigation issues on page refresh in Android PhoneGap applications using jQuery Mobile.</dd>
<br />
<dt><code>pushStateEnabled</code> <em>boolean</em>, default: true</dt>
<dt id="pushStateEnabled"><code>pushStateEnabled</code> <em>boolean</em>, default: true</dt>
<dd>Enhancement to use <code>history.replaceState</code> in supported browsers, to convert the hash-based Ajax URL into the full document path. Note that we recommend disabling this feature if Ajax is disabled or if external links are used extensively.</dd>
<br />
<dt><code>subPageUrlKey</code> <em>string</em>, default: "ui-page"</dt>
<dt id="subPageUrlKey"><code>subPageUrlKey</code> <em>string</em>, default: "ui-page"</dt>
<dd>The url parameter used for referencing widget-generated sub-pages (such as those generated by nested listviews). Translates 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>
<br />
<dt><code>touchOverflowEnabled</code> <em>boolean</em>, default: false</dt>
<dd>
Enable smoother page transitions and true fixed toolbars in devices that support both the <code>overflow:</code> and <code>overflow-scrolling: touch; </code> CSS properties.
<div class="warning"><strong>Deprecated</strong> in 1.1.0</div>
</dd>

<dt><code>transitionFallbacks.[transition]</code> <em>string</em>, default: "fade"</dt>
<dt id="transitionFallbacks.[transition]"><code>transitionFallbacks.[transition]</code> <em>string</em>, default: "fade"</dt>
<dd>Set the fallback transition for browsers that don't support 3D transforms for a specific transition type.</dd>

</dl>
@@ -1,9 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>

<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="viewport" content="width=device-width, initial-scale=1">

<link rel="stylesheet" href="//code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.css" />
<script src="//code.jquery.com/jquery-1.9.1.min.js"></script>
@@ -20,14 +20,13 @@
padding:10px 15px 0px 15px;
}
</style>
</head>
</head>

<body>
<body>
<div data-role="page" style="max-height:90px; min-height:90px;">
<div data-role="content" >
<div data-role="content" >
<a href="index.html" data-role="button">Link button</a>
</div>
</div>
</body>
</html>

@@ -1,9 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>

<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="viewport" content="width=device-width, initial-scale=1">

<link rel="stylesheet" href="//code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.css" />
<script src="//code.jquery.com/jquery-1.9.1.min.js"></script>
@@ -20,14 +20,13 @@
padding:10px 15px 0px 15px;
}
</style>
</head>
</head>

<body>
<body>
<div data-role="page" style="max-height:90px; min-height:90px;">
<div data-role="content" >
<div data-role="content" >
<a href="index.html" data-role="button" data-icon="delete" data-iconpos="left">Delete</a>
</div>
</div>
</body>
</html>

@@ -1,9 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>

<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="viewport" content="width=device-width, initial-scale=1">

<link rel="stylesheet" href="//code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.css" />
<script src="//code.jquery.com/jquery-1.9.1.min.js"></script>
@@ -20,11 +20,11 @@
padding:10px 15px 0px 15px;
}
</style>
</head>
</head>

<body>
<body>
<div data-role="page" style="max-height:360px; min-height:360px;">
<div data-role="content" >
<div data-role="content" >
<p>Creates this button with right-aligned icon:</p>
<a href="index.html" data-role="button" data-icon="delete" data-iconpos="right">Delete</a>
<p>Icons can also be positioned above the text by specifying <code> data-iconpos="top"</code></p>
@@ -35,4 +35,3 @@
</div>
</body>
</html>

@@ -1,9 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>

<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="viewport" content="width=device-width, initial-scale=1">

<link rel="stylesheet" href="//code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.css" />
<script src="//code.jquery.com/jquery-1.9.1.min.js"></script>
@@ -20,14 +20,13 @@
padding:10px 15px 0px 15px;
}
</style>
</head>
</head>

<body>
<body>
<div data-role="page" style="max-height:60px; min-height:60px;">
<div data-role="content" >
<div data-role="content" >
<a href="index.html" data-role="button" data-icon="delete" data-iconpos="notext">Delete</a>
</div>
</div>
</body>
</html>

@@ -1,9 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>

<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="viewport" content="width=device-width, initial-scale=1">

<link rel="stylesheet" href="//code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.css" />
<script src="//code.jquery.com/jquery-1.9.1.min.js"></script>
@@ -20,11 +20,11 @@
padding:10px 15px 0px 15px;
}
</style>
</head>
</head>

<body>
<body>
<div data-role="page" style="max-height:90px; min-height:90px;">
<div data-role="content" >
<div data-role="content" >
<a href="index.html" data-role="button" data-icon="delete" data-iconpos="left" data-mini="true" data-inline="true">Delete</a>
<a href="index.html" data-role="button" data-icon="delete" data-iconpos="right" data-mini="true" data-inline="true">Delete</a>
<a href="index.html" data-role="button" data-icon="delete" data-iconpos="top" data-mini="true" data-inline="true">Delete</a>
@@ -34,4 +34,3 @@
</div>
</body>
</html>

@@ -1,9 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>

<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="viewport" content="width=device-width, initial-scale=1">

<link rel="stylesheet" href="//code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.css" />
<script src="//code.jquery.com/jquery-1.9.1.min.js"></script>
@@ -20,11 +20,11 @@
padding:10px 15px 0px 15px;
}
</style>
</head>
</head>

<body>
<body>
<div data-role="page" style="max-height:450px; min-height:450px;">
<div data-role="content" >
<div data-role="content" >
<p><strong>Swatch "a"</strong> themed buttons</p>
<div data-role="controlgroup" data-type="horizontal">
<a href="index.html" data-role="button" data-icon="bars" data-iconpos="notext" data-theme="a" data-inline="true">My button</a>
@@ -1,9 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>

<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="viewport" content="width=device-width, initial-scale=1">

<link rel="stylesheet" href="//code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.css" />
<script src="//code.jquery.com/jquery-1.9.1.min.js"></script>
@@ -20,14 +20,13 @@
padding:10px 15px 0px 15px;
}
</style>
</head>
</head>

<body>
<body>
<div data-role="page" style="max-height:90px; min-height:90px;">
<div data-role="content" >
<div data-role="content" >
<a href="index.html" data-role="button" class="ui-disabled">Link button</a>
</div>
</div>
</body>
</html>