@@ -12,10 +12,10 @@
<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.</p>
<p>In this example, the acceptable range is 0-100.</p>

<pre><code>
&lt;label for="slider-1"&gt;Input slider:&lt;/label&gt;
&lt;input type="range" name="slider-1" id="slider-1" value="60" min="0" max="100" /&gt;
</code></pre>
<pre><code><![CDATA[
<label for="slider-1">Input slider:</label>
<input type="range" name="slider-1" id="slider-1" value="60" min="0" max="100" />
]]></code></pre>

<p>The default slider with these settings is displayed like this:
<iframe src="/resources/slider/example1.html" style="width:100%;height:90px;border:0px"></iframe></p>
@@ -24,10 +24,10 @@
<p>To force the slider 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 50 and the maximum value is 500.</p>
<p>In this example, the acceptable range is 0-100.</p>

<pre><code>
&lt;label for="slider-1"&gt;Input slider:&lt;/label&gt;
&lt;input type="range" name="slider-1" id="slider-1" value="60" min="0" max="100" /&gt;
</code></pre>
<pre><code><![CDATA[
<label for="slider-1">Input slider:</label>
<input type="range" name="slider-1" id="slider-1" value="60" min="0" max="100" />
]]></code></pre>

<p>This will produce an input that snaps to increments of 50. 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/slider/example2.html" style="width:100%;height:90px;border:0px"></iframe></p>
@@ -36,21 +36,21 @@

<p>To have a highlight fill on the track up to the slider handle position, add the <code>data-highlight="true"</code> attribute to the input. The fill uses active state swatch. </p>

<pre><code>
&lt;label for="slider-fill"&gt;Input slider:&lt;/label&gt;
&lt;input type="range" name="slider-fill" id="slider-fill" value="60" min="0" max="100" data-highlight="true" /&gt;
</code></pre>
<pre><code><![CDATA[
<label for="slider-fill">Input slider:</label>
<input type="range" name="slider-fill" id="slider-fill" value="60" min="0" max="100" data-highlight="true" />
]]></code></pre>

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

<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="slider-mini"&gt;Input slider:&lt;/label&gt;
&lt;input type="range" name="slider-mini" id="slider-mini" value="25" min="0" max="100" data-highlight="true" data-mini="true" /&gt;
</code></pre>
<pre><code><![CDATA[
<label for="slider-mini">Input slider:</label>
<input type="range" name="slider-mini" id="slider-mini" value="25" min="0" max="100" data-highlight="true" data-mini="true" />
]]></code></pre>

<p>This will produce a slider and its corresponding input that are not as tall as the standard version. The input also has a smaller text size.
<iframe src="/resources/slider/example3.html" style="width:100%;height:90px;border:0px"></iframe></p>
@@ -60,12 +60,12 @@
<p>Optionally wrap the slider markup in a container with class <code>ui-field-contain</code> 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>
<p><strong>Note: The <code>data-</code> attribute <code>data-role="fieldcontain"</code> is deprecated as of jQuery Mobile 1.4.0 and will be removed in 1.5.0. Add class <code>ui-field-contain</code> instead.</strong></p>

<pre><code>
&lt;div class="ui-field-contain"&gt;
&lt;label for="slider-2"&gt;Input slider:&lt;/label&gt;
&lt;input type="range" name="slider-2" id="slider-2" value="25" min="0" max="100" /&gt;
&lt;/div&gt;
</code></pre>
<pre><code><![CDATA[
<div class="ui-field-contain">
<label for="slider-2">Input slider:</label>
<input type="range" name="slider-2" id="slider-2" value="25" min="0" max="100" />
</div>
]]></code></pre>

<p>The slider is now displayed like this:
<iframe src="/resources/slider/example4.html" style="width:100%;height:90px;border:0px"></iframe></p>
@@ -76,20 +76,20 @@

<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 slider plugin on any selector, just like any jQuery plugin:</p>

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

<h3>Theming the slider</h3>

<p>To set the theme swatch for the slider, add a <code>data-theme</code> attribute to the <code>input</code> which will apply the theme to both the input, handle 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 class="ui-field-contain"&gt;
&lt;label for="slider-3"&gt;Input slider:&lt;/label&gt;
&lt;input type="range" name="slider-3" id="slider-3" value="25" min="0" max="100" data-theme="b" data-track-theme="a" /&gt;
&lt;/div&gt;
</code></pre>
<pre><code><![CDATA[
<div class="ui-field-contain">
<label for="slider-3">Input slider:</label>
<input type="range" name="slider-3" id="slider-3" value="25" min="0" max="100" data-theme="b" data-track-theme="a" />
</div>
]]></code></pre>

<p>This will produce a themed slider:
<iframe src="/resources/slider/example5.html" style="width:100%;height:90px;border:0px"></iframe></p>
@@ -100,13 +100,13 @@ $( "input" ).slider();
<p>To create a flip toggle, start with a <code>select</code> with two options. The first option will be styled as the "off" state switch and the second will be styled as the "on" state so write your options accordingly.</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="flip-1"&gt;Flip switch:&lt;/label&gt;
&lt;select name="flip-1" id="flip-1" data-role="slider"&gt;
&lt;option value="off"&gt;Off&lt;/option&gt;
&lt;option value="on"&gt;On&lt;/option&gt;
&lt;/select&gt;
</code></pre>
<pre><code><![CDATA[
<label for="flip-1">Flip switch:</label>
<select name="flip-1" id="flip-1" data-role="slider">
<option value="off">Off</option>
<option value="on">On</option>
</select>
]]></code></pre>

<p>This will produce a basic flip toggle switch input. The default styles set the width of the switch to 100% of the parent container and stack the label on a separate line.
<iframe src="/resources/switch/example1.html" style="width:100%;height:90px;border:0px"></iframe></p>
@@ -115,15 +115,15 @@ $( "input" ).slider();

<p>The control is proportionally scaled, so to use longer labels one can just add a line of CSS setting the switch to the desired width. For example, given the following markup:</p>

<pre><code>
&lt;div class="containing-element"&gt;
&lt;label for="flip-min"&gt;Flip switch:&lt;/label&gt;
&lt;select name="flip-min" id="flip-min" data-role="slider"&gt;
&lt;option value="off"&gt;Switch Off&lt;/option&gt;
&lt;option value="on"&gt;Switch On&lt;/option&gt;
&lt;/select&gt;
&lt;/div&gt;
</code></pre>
<pre><code><![CDATA[
<div class="containing-element">
<label for="flip-min">Flip switch:</label>
<select name="flip-min" id="flip-min" data-role="slider">
<option value="off">Switch Off</option>
<option value="on">Switch On</option>
</select>
</div>
]]></code></pre>

<p><code>.containing-element .ui-slider-switch { width: 9em }</code> will produce:
<iframe src="/resources/switch/example2.html" style="width:100%;height:90px;border:0px"></iframe></p>
@@ -134,13 +134,13 @@ $( "input" ).slider();

<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="flip-mini"&gt;Select slider:&lt;/label&gt;
&lt;select name="flip-mini" id="flip-mini" data-role="slider" data-mini="true"&gt;
&lt;option value="off"&gt;Off&lt;/option&gt;
&lt;option value="on"&gt;On&lt;/option&gt;
&lt;/select&gt;
</code></pre>
<pre><code><![CDATA[
<label for="flip-mini">Select slider:</label>
<select name="flip-mini" id="flip-mini" data-role="slider" data-mini="true">
<option value="off">Off</option>
<option value="on">On</option>
</select>
]]></code></pre>

<p>This will produce a flip switch that is not as tall as the standard version and has a smaller text size.
<iframe src="/resources/switch/example3.html" style="width:100%;height:90px;border:0px"></iframe></p>
@@ -150,15 +150,15 @@ $( "input" ).slider();
<p>Optionally wrap the switch markup in a container with class <code>ui-field-contain</code> 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>
<p><strong>Note: The <code>data-</code> attribute <code>data-role="fieldcontain"</code> is deprecated as of jQuery Mobile 1.4.0 and will be removed in 1.5.0. Add class <code>ui-field-contain</code> instead.</strong></p>

<pre><code>
&lt;div class="ui-field-contain"&gt;
&lt;label for="flip-2"&gt;Select slider:&lt;/label&gt;
&lt;select name="flip-2" id="flip-2" data-role="slider" data-mini="true"&gt;
&lt;option value="off"&gt;Off&lt;/option&gt;
&lt;option value="on"&gt;On&lt;/option&gt;
&lt;/select&gt;
&lt;/div&gt;
</code></pre>
<pre><code><![CDATA[
<div class="ui-field-contain">
<label for="flip-2">Select slider:</label>
<select name="flip-2" id="flip-2" data-role="slider" data-mini="true">
<option value="off">Off</option>
<option value="on">On</option>
</select>
</div>
]]></code></pre>

<p>The flip toggle switch is now displayed like this:
<iframe src="/resources/switch/example4.html" style="width:100%;height:90px;border:0px"></iframe></p>
@@ -167,15 +167,15 @@ $( "input" ).slider();

<p>Like all form elements, this widget will automatically inherit the theme from its parent container. To choose a specific theme color swatch, specify the <code>data-theme</code> attribute on the <code>select</code> and specify a swatch letter.</p>

<pre><code>
&lt;div class=&quot;ui-field-contain&quot;&gt;
&lt;label for=&quot;flip-3&quot;&gt;Flip switch:&lt;/label&gt;
&lt;select name=&quot;flip-3&quot; id=&quot;flip-3&quot; data-role=&quot;slider&quot; data-theme=&quot;b&quot;&gt;
&lt;option value=&quot;no&quot;&gt;No&lt;/option&gt;
&lt;option value=&quot;yes&quot;&gt;Yes&lt;/option&gt;
&lt;/select&gt;
&lt;/div&gt;
</code></pre>
<pre><code><![CDATA[
<div class="ui-field-contain">
<label for="flip-3">Flip switch:</label>
<select name="flip-3" id="flip-3" data-role="slider" data-theme="b">
<option value="no">No</option>
<option value="yes">Yes</option>
</select>
</div>
]]></code></pre>

<p>This results in a switch with the swatch "b" colors for the handle. Note that the lefthand "on" state gets the active state color.
<iframe src="/resources/switch/example5.html" style="width:100%;height:90px;border:0px"></iframe></p>
@@ -185,15 +185,15 @@ $( "input" ).slider();
<p>It is also possible to theme the track of the flip switch by adding the <code>data-track-theme</code> attribute and specifying the chosen swatch letter on the <code>select</code>.</p>
<p>Here's an example of a flip switch with the swatch "a" applied to the track and swatch "c" applied to the handle:</p>

<pre><code>
&lt;div class="ui-field-contain"&gt;
&lt;label for="flip-5"&gt;Flip switch:&lt;/label&gt;
&lt;select name="flip-5" id="flip-5" data-role="slider" data-theme="a" data-track-theme="b"&gt;
&lt;option value="no"&gt;No&lt;/option&gt;
&lt;option value="yes"&gt;Yes&lt;/option&gt;
&lt;/select&gt;
&lt;/div&gt;
</code></pre>
<pre><code><![CDATA[
<div class="ui-field-contain">
<label for="flip-5">Flip switch:</label>
<select name="flip-5" id="flip-5" data-role="slider" data-theme="a" data-track-theme="b">
<option value="no">No</option>
<option value="yes">Yes</option>
</select>
</div>
]]></code></pre>

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

@@ -209,29 +209,29 @@ $( "input" ).slider();

<p>Like all form elements, this widget will automatically inherit the theme from its parent container. To choose a specific theme color swatch, specify the <code>data-theme</code> attribute on the select and specify a swatch letter.</p>

<pre><code>
&lt;div class="ui-field-contain"&gt;
&lt;label for="flip-3"&gt;Flip switch:&lt;/label&gt;
&lt;select name="flip-3" id="flip-3" data-role="slider" data-theme="a"&gt;
&lt;option value="no"&gt;No&lt;/option&gt;
&lt;option value="yes"&gt;Yes&lt;/option&gt;
&lt;/select&gt;
&lt;/div&gt;
</code></pre>
<pre><code><![CDATA[
<div class="ui-field-contain">
<label for="flip-3">Flip switch:</label>
<select name="flip-3" id="flip-3" data-role="slider" data-theme="a">
<option value="no">No</option>
<option value="yes">Yes</option>
</select>
</div>
]]></code></pre>

<p>This results in a switch with the swatch "a" colors for the handle. Note that the lefthand "on" state gets the active state color.</p>
<p>It is also possible to theme the track of the flip switch by adding the data-track-theme attribute and specifying the chosen swatch letter on the select.</p>
<p>Here's an example of a flip switch with the swatch "a" applied to the track and swatch "c" applied to the handle:</p>

<pre><code>
&lt;div class="ui-field-contain"&gt;
&lt;label for="flip-5"&gt;Flip switch:&lt;/label&gt;
&lt;select name="flip-5" id="flip-5" data-role="slider" data-theme="a" data-track-theme="b"&gt;
&lt;option value="no"&gt;No&lt;/option&gt;
&lt;option value="yes"&gt;Yes&lt;/option&gt;
&lt;/select&gt;
&lt;/div&gt;
</code></pre>
<pre><code><![CDATA[
<div class="ui-field-contain">
<label for="flip-5">Flip switch:</label>
<select name="flip-5" id="flip-5" data-role="slider" data-theme="a" data-track-theme="b">
<option value="no">No</option>
<option value="yes">Yes</option>
</select>
</div>
]]></code></pre>

</longdesc>
<added>1.0</added>
@@ -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>
@@ -14,7 +14,9 @@

<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>

@@ -31,17 +33,19 @@
<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 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 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>

@@ -64,7 +68,7 @@
<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>
<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,
@@ -79,10 +83,10 @@
display: table-cell;
}
}
...more breakpoints...
</code></pre>
/* ...more breakpoints... */
]]></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>
<pre><code><![CDATA[
/* Manually hidden */
.my-custom-class th.ui-table-cell-hidden,
.my-custom-class td.ui-table-cell-hidden {
@@ -94,15 +98,17 @@
.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>

@@ -144,44 +150,111 @@
<p>The popup widget must contain a single controlgroup widget which in turn contains all the checkboxes representing the columns of the table.</p>
<p>In the example below the parameter <code>data-column-btn-theme="b"</code> is added to the table explicitly to indicate that the theme applied to the "Columns..." button is not the default (<code>null</code>).</p>

<pre><code>
&lt;div data-role=&quot;popup&quot; id=&quot;table-column-toggle-popup&quot; class=&quot;ui-table-columntoggle-popup&quot;&gt;
&lt;fieldset data-role=&quot;controlgroup&quot;&gt;
&lt;label&gt;Rank&lt;input type=&quot;checkbox&quot; checked data-cacheval=&quot;false&quot; locked=&quot;true&quot;&gt;&lt;/input&gt;&lt;/label&gt;
&lt;label&gt;Year&lt;input type=&quot;checkbox&quot; checked data-cacheval=&quot;false&quot; locked=&quot;true&quot;&gt;&lt;/input&gt;&lt;/label&gt;
&lt;label&gt;Rotten Tomato Rating&lt;input type=&quot;checkbox&quot; checked data-cacheval=&quot;false&quot; locked=&quot;true&quot;&gt;&lt;/input&gt;&lt;/label&gt;
&lt;label&gt;Reviews&lt;input type=&quot;checkbox&quot; checked data-cacheval=&quot;false&quot; locked=&quot;true&quot;&gt;&lt;/input&gt;&lt;/label&gt;
&lt;/fieldset&gt;
&lt;/div&gt;
&lt;a href=&quot;#table-column-toggle-popup&quot; class=&quot;ui-table-columntoggle-btn ui-btn ui-btn-b ui-corner-all ui-shadow ui-mini&quot; data-rel=&quot;popup&quot;&gt;Columns...&lt;/a&gt;
&lt;table data-role=&quot;table&quot; id=&quot;table-column-toggle&quot; data-mode=&quot;columntoggle&quot; data-enhanced=&quot;true&quot; class=&quot;ui-table ui-table-columntoggle&quot; data-column-btn-theme=&quot;b&quot;&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th data-priority=&quot;2&quot; data-colstart=&quot;1&quot; class=&quot;ui-table-priority-2 ui-table-cell-visible&quot;&gt;Rank&lt;/th&gt;
&lt;th data-colstart=&quot;2&quot;&gt;Movie Title&lt;/th&gt;
&lt;th data-priority=&quot;3&quot; data-colstart=&quot;3&quot; class=&quot;ui-table-priority-3 ui-table-cell-visible&quot;&gt;Year&lt;/th&gt;
&lt;th data-priority=&quot;1&quot; data-colstart=&quot;4&quot; class=&quot;ui-table-priority-1 ui-table-cell-visible&quot;&gt;&lt;abbr title=&quot;Rotten Tomato Rating&quot;&gt;Rating&lt;/abbr&gt;&lt;/th&gt;
&lt;th data-priority=&quot;5&quot; data-colstart=&quot;5&quot; class=&quot;ui-table-priority-5 ui-table-cell-visible&quot;&gt;Reviews&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;th class=&quot;ui-table-priority-2 ui-table-cell-visible&quot;&gt;1&lt;/th&gt;
&lt;td&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Citizen_Kane&quot; data-rel=&quot;external&quot;&gt;Citizen Kane&lt;/a&gt;&lt;/td&gt;
&lt;td class=&quot;ui-table-priority-3 ui-table-cell-visible&quot;&gt;1941&lt;/td&gt;
&lt;td class=&quot;ui-table-priority-1 ui-table-cell-visible&quot;&gt;100%&lt;/td&gt;
&lt;td class=&quot;ui-table-priority-5 ui-table-cell-visible&quot;&gt;74&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;th class=&quot;ui-table-priority-2 ui-table-cell-visible&quot;&gt;2&lt;/th&gt;
&lt;td&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Casablanca_(film)&quot; data-rel=&quot;external&quot;&gt;Casablanca&lt;/a&gt;&lt;/td&gt;
&lt;td class=&quot;ui-table-priority-3 ui-table-cell-visible&quot;&gt;1942&lt;/td&gt;
&lt;td class=&quot;ui-table-priority-1 ui-table-cell-visible&quot;&gt;97%&lt;/td&gt;
&lt;td class=&quot;ui-table-priority-5 ui-table-cell-visible&quot;&gt;64&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
</code></pre>
<pre><code><![CDATA[
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>table-columntoggle demo</title>
<link rel="stylesheet" href="http://code.jquery.com/mobile/git/jquery.mobile-git.min.css">
<script src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
<script src="http://code.jquery.com/mobile/git/jquery.mobile-git.min.js"></script>
</head>
<body>
<div data-role="page">
<div data-role="header">
<h1>jQuery Mobile Example</h1>
</div>
<div role="main" class="ui-content">
<table data-role="table" id="table-column-toggle" data-mode="columntoggle" class="ui-responsive table-stroke">
<thead>
<tr>
<th data-priority="2">Rank</th>
<th>Movie Title</th>
<th data-priority="3">Year</th>
<th data-priority="1"><abbr title="Rotten Tomato Rating">Rating</abbr></th>
<th data-priority="5">Reviews</th>
</tr>
</thead>
<tbody>
<tr>
<th>1</th>
<td><a href="http://en.wikipedia.org/wiki/Citizen_Kane" data-rel="external">Citizen Kane</a></td>
<td>1941</td>
<td>100%</td>
<td>74</td>
</tr>
<tr>
<th>2</th>
<td><a href="http://en.wikipedia.org/wiki/Casablanca_(film)" data-rel="external">Casablanca</a></td>
<td>1942</td>
<td>97%</td>
<td>64</td>
</tr>
<tr>
<th>3</th>
<td><a href="http://en.wikipedia.org/wiki/The_Godfather" data-rel="external">The Godfather</a></td>
<td>1972</td>
<td>97%</td>
<td>87</td>
</tr>
<tr>
<th>4</th>
<td><a href="http://en.wikipedia.org/wiki/Gone_with_the_Wind_(film)" data-rel="external">Gone with the Wind</a></td>
<td>1939</td>
<td>96%</td>
<td>87</td>
</tr>
<tr>
<th>5</th>
<td><a href="http://en.wikipedia.org/wiki/Lawrence_of_Arabia_(film)" data-rel="external">Lawrence of Arabia</a></td>
<td>1962</td>
<td>94%</td>
<td>87</td>
</tr>
<tr>
<th>6</th>
<td><a href="http://en.wikipedia.org/wiki/Dr._Strangelove" data-rel="external">Dr. Strangelove Or How I Learned to Stop Worrying and Love the Bomb</a></td>
<td>1964</td>
<td>92%</td>
<td>74</td>
</tr>
<tr>
<th>7</th>
<td><a href="http://en.wikipedia.org/wiki/The_Graduate" data-rel="external">The Graduate</a></td>
<td>1967</td>
<td>91%</td>
<td>122</td>
</tr>
<tr>
<th>8</th>
<td><a href="http://en.wikipedia.org/wiki/The_Wizard_of_Oz_(1939_film)" data-rel="external">The Wizard of Oz</a></td>
<td>1939</td>
<td>90%</td>
<td>72</td>
</tr>
<tr>
<th>9</th>
<td><a href="http://en.wikipedia.org/wiki/Singin%27_in_the_Rain" data-rel="external">Singin' in the Rain</a></td>
<td>1952</td>
<td>89%</td>
<td>85</td>
</tr>
<tr>
<th>10</th>
<td class="title"><a href="http://en.wikipedia.org/wiki/Inception" data-rel="external">Inception</a></td>
<td>2010</td>
<td>84%</td>
<td>78</td>
</tr>
</tbody>
</table>
</div>
</div>
</body>
</html>
]]></code></pre>
<iframe src="../resources/table-columntoggle/example1.html" style="width: 100%; height: 240px; border: 0px;"></iframe>

</longdesc>
@@ -11,21 +11,29 @@

<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>

@@ -37,7 +45,7 @@
<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 ) {
<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,
@@ -54,7 +62,7 @@
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>

@@ -70,7 +78,9 @@
<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>
@@ -92,11 +102,11 @@
</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>
@@ -19,27 +19,28 @@
<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">
@@ -11,21 +11,21 @@
<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>
@@ -34,10 +34,10 @@
<p>The <code>clearButton</code> extension provides the <code>clearBtn</code> option.</p>
<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 those coded via <code>textarea</code> elements.</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>
@@ -48,12 +48,12 @@
<p>Optionally wrap the text input in a container with class <code>ui-field-contain</code> to help visually group it in a longer form.</p>
<p><strong>Note: The <code>data-</code> attribute <code>data-role="fieldcontain"</code> is deprecated as of jQuery Mobile 1.4.0 and will be removed in 1.5.0. Add class <code>ui-field-contain</code> instead.</strong></p>

<pre><code>
&lt;div class=&quot;ui-field-contain&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>
<pre><code><![CDATA[
<div class="ui-field-contain">
<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>
@@ -70,32 +70,32 @@
<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 class <code>ui-field-contain</code> to group them.</p>
<p><strong>Note: The <code>data-</code> attribute <code>data-role="fieldcontain"</code> is deprecated as of jQuery Mobile 1.4.0 and will be removed in 1.5.0. Add class <code>ui-field-contain</code> instead.</strong></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 class=&quot;ui-field-contain&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 class="ui-field-contain">
<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>
<pre><code><![CDATA[
$( "input" ).textinput();
</code></pre>
]]></code></pre>

<h3>Degraded input types</h3>

@@ -110,21 +110,21 @@ $( "input" ).textinput();
<p>Search inputs are a new HTML type styled with pill-shaped corners and 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>
@@ -134,12 +134,12 @@ $( "input" ).textinput();
<p>Optionally wrap the search input in a container with tlass <code>ui-field-contain</code> to help visually group it in a longer form.</p>
<p><strong>Note: The <code>data-</code> attribute <code>data-role="fieldcontain"</code> is deprecated as of jQuery Mobile 1.4.0 and will be removed in 1.5.0. Add class <code>ui-field-contain</code> instead.</strong></p>

<pre><code>
&lt;div class=&quot;ui-field-contain&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 class="ui-field-contain">
<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>
@@ -160,18 +160,18 @@ $( "input" ).textinput();

<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>
<pre><code><![CDATA[
$( ".mySearchInput" ).textinput();
</code></pre>
]]></code></pre>

<xi:include href="../includes/pre-rendered-common.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
<p>The <placeholder name="name"/> widget wraps <code>input</code>-based widgets in <code>div</code> used for creating the style. <code>textarea</code> elements are not wrapped in such a <code>div</code>.</p>
<p>In the example below, we add the attribute <code>data-corners="false"</code> to the input, because the class <code>ui-corner-all</code> is absent from the wrapper, indicating that the value of the "corners" option should be false.</p>
<pre><code>
<pre><code><![CDATA[
<div class="ui-input-text ui-body-inherit ui-shadow-inset">
<input type="text" data-enhanced="true" data-corners="false" name="pre-rendered-text-field" id="pre-rendered-text-field"></input>
<input type="text" data-enhanced="true" data-corners="false" name="pre-rendered-text-field" id="pre-rendered-text-field"/>
</div>
</code></pre>
]]></code></pre>
<iframe src="/resources/textinput/example8.html" style="width:100%;height:90px;border:0px"></iframe>

</longdesc>
@@ -12,11 +12,11 @@
<p>The header is a <placeholder name="name"/> at the top of the page that usually contains the page title text and optional buttons positioned to the left and/or right of the title for navigation or actions. Headers can optionally be positioned as fixed so they remain at the top of the screen at all times instead of scrolling with the page.</p>
<p>The title text is normally an H1 heading element but it's possible to use any heading level (H1-H6) to allow for semantic flexibility. For example, a page containing multiple mobile "pages" may use a H1 element on the home "page" and a H2 element on the secondary pages. All heading levels are styled identically by default to maintain visual consistency.</p>

<pre><code>
&lt;div data-role="header"&gt;
&lt;h1&gt; Page Title &lt;/h1&gt;
&lt;/div&gt;
</code></pre>
<pre><code><![CDATA[
<div data-role="header">
<h1> Page Title </h1>
</div>
]]></code></pre>
<iframe src="/resources/toolbar/example1.html" style="width:100%;height:90px;border:0px"></iframe>

<h3>Default header features</h3>
@@ -33,51 +33,51 @@
<p><strong>The behavior whereby the first two buttons automatically get the <code>ui-btn-left</code> and <code>ui-btn-right</code> classes is deprecated as of jQuery Mobile 1.4.0 and will be removed in 1.5.0. Thereafter you must add those classes in your markup if you wish to position the buttons left and/or right.</strong></p>
<p>The <placeholder name="name"/> plugin looks for immediate children of the header container, and automatically sets the first link in the left button slot and the second link in the right. In this example, the 'Cancel' button will appear in the left slot and 'Save' will appear in the right slot based on their sequence in the source order. </p>

<pre><code>
&lt;div data-role=&quot;header&quot;&gt;
&lt;a href=&quot;index.html&quot; data-role=&quot;button&quot; data-icon=&quot;delete&quot;&gt;Cancel&lt;/a&gt;
&lt;h1&gt;Edit Contact&lt;/h1&gt;
&lt;a href=&quot;index.html&quot; data-role=&quot;button&quot; data-icon=&quot;check&quot;&gt;Save&lt;/a&gt;
&lt;/div&gt;
</code></pre>
<pre><code><![CDATA[
<div data-role="header">
<a href="index.html" data-role="button" data-icon="delete">Cancel</a>
<h1>Edit Contact</h1>
<a href="index.html" data-role="button" data-icon="check">Save</a>
</div>
]]></code></pre>

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

<h3>Making buttons visually stand out</h3>

<p>Buttons automatically adopt the swatch color of the bar they sit in, so a link in a header bar with the "a" color will also be styled as "a" colored buttons. It's simple to make a button visually stand out. Here, we add the <code>data-theme</code> attribute and set the color swatch for the button to "b" to make the "Save" button stand out.</p>

<pre><code>
&lt;div data-role=&quot;header&quot;&gt;
&lt;a href=&quot;index.html&quot; data-role=&quot;button&quot; data-icon=&quot;delete&quot;&gt;Cancel&lt;/a&gt;
&lt;h1&gt;Edit Contact&lt;/h1&gt;
&lt;a href=&quot;index.html&quot; data-role=&quot;button&quot; data-icon=&quot;check&quot; data-theme=&quot;b&quot;&gt;Save&lt;/a&gt;
&lt;/div&gt;
</code></pre>
<pre><code><![CDATA[
<div data-role="header">
<a href="index.html" data-role="button" data-icon="delete">Cancel</a>
<h1>Edit Contact</h1>
<a href="index.html" data-role="button" data-icon="check" data-theme="b">Save</a>
</div>
]]></code></pre>

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

<h4>Controlling button position with classes</h4>
<p>The button position can also be controlled by adding classes to the button anchors, rather than relying on source order. This is especially useful if you only want a button in the right slot. To specify the button position, add the class of <code>ui-btn-left</code> or <code>ui-btn-right</code> to the anchor.</p>

<pre><code>
&lt;div data-role=&quot;header&quot;&gt;
&lt;h1&gt;Page Title&lt;/h1&gt;
&lt;a href=&quot;index.html&quot; data-role=&quot;button&quot; data-icon=&quot;gear&quot; class=&quot;ui-btn-right&quot;&gt;Options&lt;/a&gt;
&lt;/div&gt;
</code></pre>
<pre><code><![CDATA[
<div data-role="header">
<h1>Page Title</h1>
<a href="index.html" data-role="button" data-icon="gear" class="ui-btn-right">Options</a>
</div>
]]></code></pre>

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

<h3>Adding buttons to <placeholder name="name"/> widgets without heading</h3>
<p>The heading in the header bar has some margin that will give the bar its height. If you choose not to use a heading, you will need to add an element with <code>class="ui-title"</code> so that the bar can get the height and display correctly.</p>

<pre><code>
&lt;div data-role=&quot;header&quot;&gt;
&lt;a href=&quot;index.html&quot; data-role=&quot;button&quot; data-icon=&quot;gear&quot; class=&quot;ui-btn-right&quot;&gt;Options&lt;/a&gt;
&lt;span class=&quot;ui-title&quot; /&gt;
&lt;/div&gt;
</code></pre>
<pre><code><![CDATA[
<div data-role="header">
<a href="index.html" data-role="button" data-icon="gear" class="ui-btn-right">Options</a>
<span class="ui-title" />
</div>
]]></code></pre>

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

@@ -99,11 +99,11 @@ If you're doing this programmatically, set this option inside the mobileinit eve
<p>If you need to create a header that doesn't follow the default configuration, simply wrap your custom styled markup in any container, such as <code>div</code>. The plugin won't apply the automatic button logic to the wrapped content inside the header container so you can write custom styles for laying out the content in your header.</p>
<p>It's also possible to create custom bars without using the header data-role at all. For example, start with any container and add the <code>ui-bar</code> class to apply standard bar padding and add the <code>ui-bar-b</code> class to assign the bar swatch styles from your theme. (The "b" can be any swatch letter.)</p>

<pre><code>
&lt;div class=&quot;ui-bar ui-bar-b&quot;&gt;
&lt;h3&gt;I&#x27;m just a div with bar classes and a mini inline &lt;a href=&quot;#&quot; data-role=&quot;button&quot; data-mini=&quot;true&quot;&gt;Button&lt;/a&gt;&lt;/h3&gt;
&lt;/div&gt;
</code></pre>
<pre><code><![CDATA[
<div class="ui-bar ui-bar-b">
<h3>I'm just a div with bar classes and a mini inline <a href="#" data-role="button" data-mini="true">Button</a></h3>
</div>
]]></code></pre>

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

@@ -118,11 +118,11 @@ If you're doing this programmatically, set this option inside the mobileinit eve
<h3>Footer bar structure</h3>
<p>The <code>footer</code> bar has the same basic structure as the header except it uses the <code>data-role</code> attribute value of <code>footer</code>.</p>

<pre><code>
&lt;div data-role="footer"&gt;
&lt;h4&gt;Footer content&lt;/h4&gt;
&lt;/div&gt;
</code></pre>
<pre><code><![CDATA[
<div data-role="footer">
<h4>Footer content</h4>
</div>
]]></code></pre>
<iframe src="/resources/toolbar/example8.html" style="width:100%;height:90px;border:0px"></iframe>

<p>The footer <placeholder name="name"/> inherits its theme swatch from the <a href="/page/">page</a> by default but you can easily set the theme swatch color by adding the <code>data-theme</code> attribute to the header. For example, <code>data-theme="b"</code>. When you use external headers you must set a theme, because there is no parent page from which it can inherit a theme.</p>
@@ -136,13 +136,13 @@ If you're doing this programmatically, set this option inside the mobileinit eve
<p>Any link or valid button markup with a <code>data-role="button"</code> attribute added to the footer will automatically be turned into a button. To save space, buttons in <placeholder name="name"/> widgets are automatically set to inline styling so the button is only as wide as the text and icons it contains.</p>
<p>By default, <placeholder name="name"/> widgets don't have any padding to accommodate nav bars and other widgets. To include padding on the bar, add a <code>class="ui-bar"</code> to the footer.</p>

<pre><code>
&lt;div data-role=&quot;footer&quot; class=&quot;ui-bar&quot;&gt;
&lt;a href=&quot;index.html&quot; data-role=&quot;button&quot; data-icon=&quot;plus&quot;&gt;Add&lt;/a&gt;
&lt;a href=&quot;index.html&quot; data-role=&quot;button&quot; data-icon=&quot;arrow-u&quot;&gt;Up&lt;/a&gt;
&lt;a href=&quot;index.html&quot; data-role=&quot;button&quot; data-icon=&quot;arrow-d&quot;&gt;Down&lt;/a&gt;
&lt;/div&gt;
</code></pre>
<pre><code><![CDATA[
<div data-role="footer" class="ui-bar">
<a href="index.html" data-role="button" data-icon="plus">Add</a>
<a href="index.html" data-role="button" data-icon="arrow-u">Up</a>
<a href="index.html" data-role="button" data-icon="arrow-d">Down</a>
</div>
]]></code></pre>

<p>This creates this <placeholder name="name"/> with buttons sitting in a row
<iframe src="/resources/toolbar/example9.html" style="width:100%;height:90px;border:0px"></iframe></p>
@@ -151,7 +151,9 @@ If you're doing this programmatically, set this option inside the mobileinit eve

<p>To group buttons together into a button set, wrap the links in a wrapper with <code>data-role=&quot;controlgroup&quot;</code> and <code>data-type=&quot;horizontal&quot;</code> attributes.</p>

<code>&lt;div data-role=&quot;controlgroup&quot; data-type=&quot;horizontal&quot;&gt;</code>
<pre><code><![CDATA[
<div data-role="controlgroup" data-type="horizontal">
]]></code></pre>

<p>This creates a grouped set of buttons:
<iframe src="/resources/toolbar/example10.html" style="width:100%;height:90px;border:0px"></iframe></p>
@@ -171,18 +173,18 @@ If you're doing this programmatically, set this option inside the mobileinit eve
<p>To enable this behavior on a header or footer, add the <code>data-position="fixed"</code> attribute to a jQuery Mobile <placeholder name="name"/> element.</p>

<p>Fixed header markup example:</p>
<pre><code>
&lt;div data-role=&quot;header&quot; data-position=&quot;fixed&quot;&gt;
&lt;h1&gt;Fixed Header&lt;/h1&gt;
&lt;/div&gt;
</code></pre>
<pre><code><![CDATA[
<div data-role="header" data-position="fixed">
<h1>Fixed Header</h1>
</div>
]]></code></pre>

<p>Fixed footer markup example:</p>
<pre><code>
&lt;div data-role=&quot;footer&quot; data-position=&quot;fixed&quot;&gt;
&lt;h1&gt;Fixed Footer&lt;/h1&gt;
&lt;/div&gt;
</code></pre>
<pre><code><![CDATA[
<div data-role="footer" data-position="fixed">
<h1>Fixed Footer</h1>
</div>
]]></code></pre>

<iframe src="/resources/toolbar/example12.html" style="width:100%;height:420px;border:0px"></iframe>

@@ -194,11 +196,11 @@ If you're doing this programmatically, set this option inside the mobileinit eve

<p>To enable this option on a fixed header or footer, add the <code>data-fullscreen</code> attribute to the element.</p>

<pre><code>
&lt;div data-role=&quot;header&quot; data-position=&quot;fixed&quot; data-fullscreen=&quot;true&quot;&gt;
&lt;h1&gt;Fixed Header!&lt;/h1&gt;
&lt;/div&gt;
</code></pre>
<pre><code><![CDATA[
<div data-role="header" data-position="fixed" data-fullscreen="true">
<h1>Fixed Header!</h1>
</div>
]]></code></pre>
<iframe src="/resources/toolbar/example13.html" style="width:100%;height:420px;border:0px"></iframe>

<h3>Forms in toolbars</h3>