diff --git a/docs/_assets/css/jqm-docs.css b/docs/_assets/css/jqm-docs.css index 0f53fb3e9d8..d103b98dbf5 100644 --- a/docs/_assets/css/jqm-docs.css +++ b/docs/_assets/css/jqm-docs.css @@ -1,7 +1,7 @@ /* jqm docs css -Beware: lots of last-minute CSS going on in here -cobblers, shoes, +Beware: lots of last-minute CSS going on in here +cobblers, shoes, */ body { background: #dddddd; } @@ -14,7 +14,7 @@ body { background: #dddddd; } .ui-mobile .jqm-themeswitcher { margin: 10px 25px 10px 10px; } h2 { margin:1.2em 0 .4em 0; } -p code { font-size:1.2em; font-weight:bold; } +p code { font-size:1.2em; font-weight:bold; } dt { font-weight: bold; margin: 2em 0 .5em; } dt code, dd code { font-size:1.3em; line-height:150%; } @@ -77,36 +77,36 @@ p.intro strong { /* new API additions */ -dt { - margin: 35px 0 15px 0; - background-color:#ddd; +dt { + margin: 35px 0 15px 0; + background-color:#ddd; font-weight:normal; } -dt code { - display:inline-block; +dt code { + display:inline-block; font-weight:bold; - color:#56A00E; - padding:3px 7px; - margin-right:10px; - background-color:#fff; + color:#56A00E; + padding:3px 7px; + margin-right:10px; + background-color:#fff; } -dd { - margin-bottom:10px; +dd { + margin-bottom:10px; } dd .default { font-weight:bold; } -dd pre { - margin:0 0 0 0; +dd pre { + margin:0 0 0 0; } dd code { font-weight: normal; } -dd pre code { - margin:0; - border:none; - font-weight:normal; - font-size:100%; - background-color:transparent; +dd pre code { + margin:0; + border:none; + font-weight:normal; + font-size:100%; + background-color:transparent; } dd h4 { margin:15px 0 0 0; } - + .localnav { margin:0 0 20px 0; overflow:hidden; @@ -114,9 +114,9 @@ dd h4 { margin:15px 0 0 0; } .localnav li { float:left; } -.localnav .ui-btn-inner { - padding: .6em 10px; - font-size:80%; +.localnav .ui-btn-inner { + padding: .6em 10px; + font-size:80%; } @@ -126,13 +126,13 @@ dd h4 { margin:15px 0 0 0; } background: #74b042; color: #fff; font-weight: bold; - text-shadow: 0 -1px 1px #234403; + text-shadow: 0 -1px 1px #234403; background-image: -webkit-gradient(linear, left top, left bottom, from(#74b042), to(#56A00E)); /* Saf4+, Chrome */ background-image: -webkit-linear-gradient(top, #74b042, #56A00E); /* Chrome 10+, Saf5.1+ */ background-image: -moz-linear-gradient(top, #74b042, #56A00E); /* FF3.6 */ background-image: -ms-linear-gradient(top, #74b042, #56A00E); /* IE10 */ background-image: -o-linear-gradient(top, #74b042, #56A00E); /* Opera 11.10+ */ - background-image: linear-gradient(top, #74b042, #56A00E); + background-image: linear-gradient(top, #74b042, #56A00E); } .ui-bar-f, .ui-bar-f .ui-link-inherit { @@ -149,7 +149,7 @@ dd h4 { margin:15px 0 0 0; } /* docs site layout */ @media all and (min-width: 650px){ - + .jqm-home { position: absolute; left: 10px; @@ -237,7 +237,7 @@ dd h4 { margin:15px 0 0 0; } margin: 0; padding: 0; } - + } @media all and (min-width: 750px){ .type-home .ui-content, @@ -250,7 +250,7 @@ dd h4 { margin:15px 0 0 0; } .content-primary { width: 56%; padding-right: 1%; - } + } .type-interior .ui-content { background-position: 34%; } diff --git a/docs/_assets/js/_viewsource.js b/docs/_assets/js/_viewsource.js index 32b53e7bcbb..14880e0df32 100644 --- a/docs/_assets/js/_viewsource.js +++ b/docs/_assets/js/_viewsource.js @@ -13,7 +13,7 @@ $.fn.addSourceLink = function(style){ "" ) .appendTo( "body" ) .page(); - + $('View Source') .buttonMarkup({ icon: 'arrow-u', @@ -30,10 +30,10 @@ $.fn.addSourceLink = function(style){ page.find('.ui-btn-left').click(function(){ $.changePage(activepage, 'slideup',true); return false; - }); - }) + }); + }) .insertAfter(this); - }); + }); }; //set up view source links diff --git a/docs/_assets/js/jqm-docs.js b/docs/_assets/js/jqm-docs.js index ffe9526622d..52ba601d3eb 100644 --- a/docs/_assets/js/jqm-docs.js +++ b/docs/_assets/js/jqm-docs.js @@ -1,16 +1,16 @@ //set up the theme switcher on the homepage $('div').live('pagecreate',function(event){ - if( !$(this).is('.ui-dialog')){ + if( !$(this).is('.ui-dialog')){ var appendEl = $(this).find('.ui-footer:last'); - + if( !appendEl.length ){ appendEl = $(this).find('.ui-content'); } - + if( appendEl.is("[data-position]") ){ return; } - + $('Switch theme') .buttonMarkup({ 'icon':'gear', @@ -23,7 +23,7 @@ $('div').live('pagecreate',function(event){ .bind( "vclick", function(){ $.themeswitcher(); }); - } + } }); @@ -37,7 +37,7 @@ $(function(){ function setDefaultTransition(){ var winwidth = $( window ).width(), trans ="slide"; - + if( winwidth >= 1000 ){ trans = "none"; } diff --git a/docs/about/accessibility.html b/docs/about/accessibility.html index 90dbd3e1d53..752d387d3c4 100755 --- a/docs/about/accessibility.html +++ b/docs/about/accessibility.html @@ -1,17 +1,17 @@ - - + +
- -jQuery Mobile is built upon standard, semantic HTML, allowing pages to be accessible to the broadest range of devices possible. For A-Grade browsers, many of the components in jQuery Mobile leverage techniques such as focus management, keyboard navigation, and HTML attributes specified in the W3C's WAI-ARIA specification.
- +jQuery Mobile is built upon standard, semantic HTML, allowing pages to be accessible to the broadest range of devices possible. For A-Grade browsers, many of the components in jQuery Mobile leverage techniques such as focus management, keyboard navigation, and HTML attributes specified in the W3C's WAI-ARIA specification.
+By utilizing these techniques, we do our best to ensure an accessible experience to users with disabilities such as blindness, who may use screen readers (like VoiceOver, on Apple's iPhone device) or other assistive technology to access the web.
- +While our accessibility implementation is currently a work in progress, we aim to provide a fully accessible suite of components for version 1.0.
- -© 2011 The jQuery Project
- + - + diff --git a/docs/about/features.html b/docs/about/features.html index 11072f560c2..e643023806b 100755 --- a/docs/about/features.html +++ b/docs/about/features.html @@ -1,29 +1,29 @@ - - + + - -jQuery’s mobile strategy can be summarized simply: A unified user interface system that works seamlessly across all popular mobile device platforms, built on the rock-solid jQuery and jQuery UI foundation. Focused on a lightweight codebase built on progressive enhancement with a flexible, easily themeable design.
The critical difference with our approach is the wide variety of mobile platforms we’re targeting with jQuery Mobile. We’ve been working hard at bringing jQuery support to all mobile browsers that are sufficiently-capable and have at least a nominal amount of market share. In this way, we’re treating mobile web browsers exactly how we treat desktop web browsers.
- +To make this broad support possible, all pages in jQuery Mobile are built on a foundation of clean, semantic HTML to ensure compatibility with pretty much any web-enabled device. In devices that interpret CSS and JavaScript, jQuery Mobile applies progressive enhancement techniques to unobtrusively transform the semantic page into a rich, interactive experience that leverages the power of jQuery and CSS. Accessibility features such as WAI-ARIA are tightly integrated throughout the framework to provide support for screen readers and other assistive technologies.
- +
- As of Beta 3, we've pretty much covered our target platforms for 1.0. At this stage, jQuery Mobile works on the vast majority of all modern desktop, smartphone, tablet, and e-reader platforms. In addition, feature phones and older browsers are also supported because of our progressive enhancement approach. We're very proud of our commitment to universal accessibility through our broad support for all popular platforms.
@@ -66,9 +66,9 @@Unlike other jQuery projects, such as jQuery and jQuery UI, jQuery Mobile automatically applies many markup enhancements as soon as it loads (long before document.ready event fires). These enhancements are applied based on jQuery Mobile's default configuration, which is designed to work with common scenarios, but may or may not match your particular needs. Fortunately, these settings are easy to configure.
- +When the jQuery Mobile starts to execute, it triggers a mobileinit event on the document object, to which you can bind to apply overrides to jQuery Mobile's defaults.
$(document).bind("mobileinit", function(){
@@ -36,7 +36,7 @@ The mobileinit event
});
-
+
Because the mobileinit event is triggered immediately upon execution, you'll need to bind your event handler before jQuery Mobile is loaded. Thus, we recommend linking to your JavaScript files in the following order:
@@ -45,10 +45,10 @@- + +The mobileinit event
<script src="custom-scripting.js"></script> <script src="jquery-mobile.js"></script> -
Within this event binding, you can configure defaults either by extending the $.mobile object using jQuery's $.extend method:
$(document).bind("mobileinit", function(){
@@ -58,7 +58,7 @@ The mobileinit event
});
-
+
...or by setting them individually:
@@ -67,13 +67,13 @@ The mobileinit event
});
-
-
+
+
The following defaults are configurable via the $.mobile object:
ns string, default: ""ns string, default: ""data-mynamespace-foo="...".
NOTE: if you're using data- namespacing, you'll need to manually update/override one selector in the theme CSS. The following data selectors should incorporate the namespace you're using:
@@ -81,76 +81,76 @@ Configurable options
autoInitializePage boolean, default: trueautoInitializePage boolean, default: true$.mobile.initializePage. If false, page will not initialize, and will be visually hidden until until $.mobile.initializePage is manually called.subPageUrlKey string, default: "ui-page"activePageClass string, default: "ui-page-active"activePageClass string, default: "ui-page-active"activeBtnClass string, default: "ui-btn-active"activeBtnClass string, default: "ui-btn-active"ajaxEnabled boolean, default: trueajaxEnabled boolean, default: truehashListeningEnabled boolean, default: truehashListeningEnabled boolean, default: truedefaultPageTransition string, default: 'slide'defaultPageTransition string, default: 'slide'touchOverflowEnabled boolean, default: falsetouchOverflowEnabled boolean, default: falseoverflow-scrolling: touch; property.defaultDialogTransition string, default: 'pop'defaultDialogTransition string, default: 'pop'minScrollBack string, default: 150minScrollBack string, default: 150loadingMessage string, default: "loading"loadingMessage string, default: "loading"pageLoadErrorMessage string, default: "Error Loading Page"pageLoadErrorMessage string, default: "Error Loading Page"gradeA function that returns a boolean, default: a function returning the value of $.support.mediaquerygradeA function that returns a boolean, default: a function returning the value of $.support.mediaqueryjQuery Mobile adds classes to the HTML element that mimic browser orientation and common min/max-width CSS media queries. These classes are updated on load, resize and orientationchange, allowing you to key off these classes in your CSS, to create responsive layouts - even in browsers that don't support media queries!
The HTML element will always have a class of either "portrait" or "landscape", depending on the orientation of the browser or device. You can utilize these in your CSS like this:
@@ -37,47 +37,47 @@By default, we create min and max breakpoint classes at the following widths: 320,480,768,1024. These translate to classes that look like this: "min-width-320px", "max-width-480px", and are meant to be used as a replacement of (or in addition to) the media query equivalents they mimic.
-.myelement {
+.myelement {
float: none;
-}
+}
.min-width-480px .myelement {
float: left;
-}
+}
-
-
+
+
Many plugins in jQuery Mobile leverage these width breakpoints. For example, form elements float beside their labels when the browser is wider than 480 pixels. The CSS to support this behavior for form text inputs looks like this:
- +
-label.ui-input-text {
- display: block;
+label.ui-input-text {
+ display: block;
}
-.min-width-480px label.ui-input-text {
- display: inline-block;
+.min-width-480px label.ui-input-text {
+ display: inline-block;
}
-
+
To utilize width breakpoints of your own, jQuery Mobile exposes the $.mobile.addResolutionBreakpoints function, which accepts either a single number or array of numbers that will be added to the min/max breakpoints whenever they apply.
-//add a min/max class for 1200 pixel widths
+//add a min/max class for 1200 pixel widths
$.mobile.addResolutionBreakpoints(1200);
-//add min/max classes for 1200, and 1440 pixel widths
+//add min/max classes for 1200, and 1440 pixel widths
$.mobile.addResolutionBreakpoints([1200, 1440]);
-
+
jQuery Mobile provides a function that allows you to test whether a particular CSS Media Query applies. Simple call $.mobile.media() and pass a media type or query. If the browser supports that type or query, and it currently applies, the function will return true. If not, it'll return false.
jQuery Mobile exposes several methods and properties on the $.mobile object for use in your applications.
- +$.mobile.changePage (method)· Argumentsto (string or object, required)
@@ -39,8 +39,8 @@ $("#about"))options (object, optional)
changeHash (boolean, default: true) Decides if the hash in the location bar should be updated. role (string, default: undefined) The data-role value to be used when displaying the page. By default this is undefined which means rely on the value of the @data-role attribute defined on the element.pageContainer (jQuery collection, default: $.mobile.pageContainer) Specifies the element that should contain the page. type (string, default: "get") Specifies the method ("get" or "post") to use when making a page request.
+ type (string, default: "get") Specifies the method ("get" or "post") to use when making a page request.
-//transition to the "about us" page with a slideup transition
-$.mobile.changePage( "about/us.html", { transition: "slideup"} );
+//transition to the "about us" page with a slideup transition
+$.mobile.changePage( "about/us.html", { transition: "slideup"} );
-//transition to the "search results" page, using data from a form with an ID of "search""
+//transition to the "search results" page, using data from a form with an ID of "search""
$.mobile.changePage( "searchresults.php", {
- type: "post",
+ type: "post",
data: $("form#search").serialize()
-});
+});
-//transition to the "confirm" page with a "pop" transition without tracking it in history
+//transition to the "confirm" page with a "pop" transition without tracking it in history
$.mobile.changePage( "../alerts/confirm.html", {
transition: "pop",
reverse: false,
changeHash: false
-});
-
+});
+
-
+
$.mobile.loadPage (method)· Argumentsurl (string or object, required) A relative or absolute URL.url (string or object, required) A relative or absolute URL.options (object, optional)
role (string, default: undefined) The data-role value to be used when displaying the page. By default this is undefined which means rely on the value of the @data-role attribute defined on the element.pageContainer (jQuery collection, default: $.mobile.pageContainer) Specifies the element that should contain the page after it is loaded. type (string, default: "get") Specifies the method ("get" or "post") to use when making a page request.
+ type (string, default: "get") Specifies the method ("get" or "post") to use when making a page request.
data (object or string, default: undefined) The data to send with an Ajax page request. reloadPage (boolean, default: false) Forces a reload of a page, even if it is already in the DOM of the page container.
-//load the "about us" page into the DOM
-$.mobile.loadPage( "about/us.html" );
+//load the "about us" page into the DOM
+$.mobile.loadPage( "about/us.html" );
-//load a "search results" page, using data from a form with an ID of "search""
+//load a "search results" page, using data from a form with an ID of "search""
$.mobile.loadPage( "searchresults.php", {
- type: "post",
+ type: "post",
data: $("form#search").serialize()
-});
+});
-
+
jqmData(), jqmRemoveData() (method)jqmData and jqmRemoveData should be used in place of jQuery core's data and removeData methods (note that this includes $.fn.data, $.fn.removeData, and the $.data, $.removeData, and $.hasData utilities), as they automatically incorporate getting and setting of namespaced data attributes (even if no namespace is currently in use).$.mobile.showPageLoadingMsg ()
-//cue the page loader
-$.mobile.showPageLoadingMsg();
+//cue the page loader
+$.mobile.showPageLoadingMsg();
-
+
$.mobile.hidePageLoadingMsg ()
-//cue the page loader
-$.mobile.hidePageLoadingMsg();
+//cue the page loader
+$.mobile.hidePageLoadingMsg();
-
+
$.mobile.path.parseUrl (method)· Argumentsurl (string, required) A relative or absolute URL.url (string, required) A relative or absolute URL.· Return ValueThis function returns an object that contains the various components of the URL as strings. The properties on the object mimic the browser's location object:
-hashhostsearch</dt>
But it also contains additional properties that provide access to additional components as well as some common forms of the URL developers access:
-authorityauthoritydirectorydomainfilenamehrefNoHashhrefNoSearchpasswordusernamedomainfilenamehrefNoHashhrefNoSearchpasswordusername
@@ -269,21 +269,21 @@ Methods
var obj = $.mobile.path.parseUrl("http://jblas:password@mycompany.com:8080/mail/inbox?msg=1234");
-
+
$.mobile.path.makePathAbsolute (method)· ArgumentsrelPath (string, required) A relative file or directory path.absPath (string, required) An absolute file or relative path to resolve against.relPath (string, required) A relative file or directory path.absPath (string, required) An absolute file or relative path to resolve against.· Return Value$.mobile.path.makeUrlAbsolute (method)relUrl (string, required) A relative URL.absUrl (string, required) An absolute URL to resolve against.relUrl (string, required) A relative URL.absUrl (string, required) An absolute URL to resolve against.$.mobile.path.isSameDomain (method)· Argumentsurl1 (string, required) A relative URL.url2 (string, required) An absolute URL to resolve against.url1 (string, required) A relative URL.url2 (string, required) An absolute URL to resolve against.$.mobile.path.isRelativeUrl (method)· Argumentsurl (string, required) A relative or absolute URL.url (string, required) A relative or absolute URL.· Return Value$.mobile.path.isAbsoluteUrl (method)· Argumentsurl (string, required) A relative or absolute URL.url (string, required) A relative or absolute URL.· Return Value$.mobile.base (methods, properties)$.mobile.silentScroll (method)yPos (number, defaults to 0). Pass any number to scroll to that Y location.
-//scroll to Y 100px
-$.mobile.silentScroll(100);
+//scroll to Y 100px
+$.mobile.silentScroll(100);
-
+
$.mobile.addResolutionBreakpoints (method)values (number or array). Pass any number or array of numbers to add to the resolution classes. Read more about this feature here: Orientation & resolution targeting.
-//add a 400px breakpoint
-$.mobile.addResolutionBreakpoints(400);
-//add 2 more breakpoints
-$.mobile.addResolutionBreakpoints([600,800]);
+//add a 400px breakpoint
+$.mobile.addResolutionBreakpoints(400);
+//add 2 more breakpoints
+$.mobile.addResolutionBreakpoints([600,800]);
-
+
$.mobile.activePage (property)Every layout and widget in jQuery Mobile is designed around a new object-oriented CSS framework that makes it possible to apply a complete unified visual design Theme to sites and applications. The theming system is similar to the ThemeRoller system in jQuery UI, but adds a few important improvements:
-Every layout and widget in jQuery Mobile is designed around a new object-oriented CSS framework that makes it possible to apply a complete unified visual design Theme to sites and applications. The theming system is similar to the ThemeRoller system in jQuery UI, but adds a few important improvements:
+ +The key to the Theme system is separation of color and texture, from structural styles that define things like padding and dimensions. This allows theme colors and textures to be defined once in the stylesheet and be mixed, matched and combined to achieve a wide range of visual effects.
- +Each Theme includes several global settings, including font family, drop shadows for overlays, and corner radius values for buttons and boxes. In addition, the Theme can include multiple color "swatches", each with color values for bars, content blocks, buttons and list items, and font text-shadow.
jQuery Mobile's default Theme includes 5 swatches that are given letters (a, b, c, d, e) for quick reference. To make mapping of color swatches consistent across our widgets, we have followed the convention that swatch "a" is the highest level of visual priority (black in our default theme), "b" is secondary level (blue) and "c" is the baseline level (gray) that we use by default in many situations, "d" for an alternate secondary level and "e" as an accent swatch. Themes may have additional swatches for accent colors or specific situations. For example, you could add a new theme swatch "f" that has a red bar and button for use in error situations.
- +A new ThemeRoller tool will launched with the jQuery Mobile 1.0 release in 2011. In the meantime, it's simple to manually edit the base swatches in the default theme and/or add additional swatches by editing the theme css file: copy a block of swatch styles, rename the classes with the new swatch letter name, and tweak colors.
- - + +The default theme contains the following five Bar styles:
- +By default, the framework assigns the "a" swatch to all headers and footers, because these are typically given high visual priority in an application. To set the color of a bar to a different swatch color, simply add the data-theme attribute to your header or footer and specify an alternate swatch letter ('b' or 'd', for example) and the specified theme swatch color will be applied. Learn more about toolbar theming.
The default theme also includes color swatch values for use in content blocks, designed to coordinate with the header color swatches in the theme.
- -If a theme isn't specified on a content block, the framework will default to "c" to maximize contrast against the default header "a", as shown here:
- +Learn more about content theming.
- +Each swatch also includes default styles for interactive elements like list items and buttons.
@@ -109,30 +109,30 @@A button is included for each swatch in the theme. Each button has styles for normal, hover/focus and pressed states.
- + - - + +By default, any button that's placed in a bar is automatically assigned a swatch letter that matches its parent bar or content box, to visually integrate the button into the parent theme like a chameleon, as shown here:
- + - +This default behavior makes it easy to ripple a theme change through a page by setting a theme swatch on a parent because you know the buttons will maintain the same relative visual weight across themes. Since form elements use the button styles, they will also adapt to their parent container too.
- +If you want to add visual emphasis to a button and help it stand out visually from its parent toolbar, an alternate swatch color can be set by adding a data-theme="a" to the anchor. Once an alternate swatch color is set on a button in the markup, the framework won't override that color if the parent theme is changed, because you made a conscious decision to set it.
Learn more about list theming and button theming.
The jQuery Mobile framework uses a single Theme-level swatch called "active" (bright blue in the default theme) to consistently indicate the selected state, regardless of the individual swatch of the given widget. We apply this in navigation and form controls whenever there is a need to indicate what is currently selected. Because this theme swatch is designed for clear, consistent user feedback, it cannot be overridden via the markup; it is set once in the Theme and applied by the framework whenever a selected or active state is needed. The styling for this state is in the theme stylesheet under the ui-btn-active style rules.
There a core set of standard icons included in the framework that can be assigned to any button. To minimize the download size of the core icons, jQuery Mobile only includes these icons in white and automatically adds a semi-transparent black circle behind the icon to make sure it has good contrast on all background colors.
- - + +Learn more about theming individual components:
To be documented
- +To be documented
- +To be documented
- +To be documented
- - - + + +Occasionally, you may want to visually group a set of buttons together to form a single block that looks contained like a navigation component. To get this effect, wrap a set of buttons in a container with the data-role="controlgroup" attribute — the framework will create a vertical button group, remove all margins and drop shadows between the buttons, and only round the first and last buttons of the set to create the effect that they are grouped together.
<div data-role="controlgroup">
@@ -33,64 +33,64 @@ Grouped buttons
By default, grouped buttons are presented as a vertical list:
- + - +By adding the data-type="horizontal" attribute to the controlgroup container, you can swap to a horizontal-style group that floats the buttons side-by-side and sets the width to only be large enough to fit the content. (Be aware that these will wrap to multiple lines if the number of buttons or the overall text length is too wide for the screen.)
-
+
Horizontal grouped buttons:
- +Horizontal grouped buttons with icons:
- +Horizontal grouped buttons, icon only:
- - -The jQuery Mobile framework includes a selected set of icons most often needed for mobile apps. To minimize download size, jQuery Mobile includes a single white icon sprite, and automatically adds a semi-transparent black circle behind the icon to ensure that it has good contrast on any background color.
- - -An icon can be added to a button by adding a data-icon attribute on the anchor specifying the icon to display. For example, the following markup:
The jQuery Mobile framework includes a selected set of icons most often needed for mobile apps. To minimize download size, jQuery Mobile includes a single white icon sprite, and automatically adds a semi-transparent black circle behind the icon to ensure that it has good contrast on any background color.
+ + +An icon can be added to a button by adding a data-icon attribute on the anchor specifying the icon to display. For example, the following markup:
<a href="index.html" data-role="button" data-icon="delete">Delete</a>
-
+
Creates this button with an icon:
Delete - +The following data-icon attributes can be referenced to create the icons shown below:
Left arrow - data-icon="arrow-l"
My buttonRight arrow - data-icon="arrow-r"
@@ -76,13 +76,13 @@Search - data-icon="search"
My button - +By default, all icons in buttons are placed to the left of the button text.
Delete - -This default may be overridden using the data-iconpos attribute to set the icon to the right, above (top) or below (bottom) the text. For example, the markup:
This default may be overridden using the data-iconpos attribute to set the icon to the right, above (top) or below (bottom) the text. For example, the markup:
<a href="index.html" data-role="button" data-icon="delete" data-iconpos="right">Delete</a>
@@ -93,10 +93,10 @@ Icon positioning
Icons can also be positioned above the text by specifying data-iconpos="top"
Delete
-
+
Or icons can also be positioned below the text by specifying data-iconpos="bottom"
Delete
-
+
You can also create an icon-only button, by setting the data-iconpos attribute to notext. The button plugin will hide the text on-screen, but add it as a title attribute on the link to provide context for screen readers and devices that support tooltips. For example, replacing data-iconpos="right" on the previous example with data-iconpos="notext":
@@ -108,11 +108,11 @@ Icon positioning
Custom Icons
To use custom icons, specify a data-icon value that has a unique name like myapp-email and the button plugin will generate a class by prefixing ui-icon- to the data-icon value and apply it to the button. You can then write a CSS rule that targets the ui-icon-myapp-email class to specify the icon background source. To maintain visual consistency, create a white icon 18x18 pixels saved as a PNG-8 with alpha transparency.
-
-
+
+
Icons and themes
The semi-transparent black circle behind the white icon ensures good contrast on any background color so it works well with the jQuery Mobile theming system. Here are examples of the same icons sitting on top of a range of different color swatches in out theme.
-
+
Swatch "A" themed buttons
-
+
Swatch "B" themed buttons
-
+
Swatch "C" themed buttons
-
- By default, all buttons in the body content are styled as block-level element so they fill the width of the screen:
- + Button - - + +However, if you want a more compact button that is only as wide as the text and icons inside, add the data-inline="true" attribute to the button:
If you have multiple buttons that should sit side-by-side on the same line, add the data-inline="true" attribute to each button. This will style the buttons to be the width of their content and float the buttons so they sit on the same line.
<a href="index.html" data-role="button" data-inline="true">Cancel</a>
<a href="index.html" data-role="button" data-inline="true" data-theme="b">Save</a>
@@ -45,10 +45,10 @@ Inline buttons
Cancel
Save
-
- If you want buttons to sit side-by-side but stretch to fill the width of the screen, you can use the content column grids to put normal full-width buttons into 2- or 3-columns.
-
- If you want buttons to sit side-by-side but stretch to fill the width of the screen, you can use the content column grids to put normal full-width buttons into 2- or 3-columns.
+ +jQuery Mobile has a rich theming system that gives you full control of how buttons are styled. When a link is added to a container, it is automatically assigned a theme swatch letter that matches it's parent bar or content box to visually integrate the button into the parent container, like a chameleon. So a button placed inside a content container with a theme of "a" (black in the default theme) will be automatically assigned the button theme of "a" (charcoal in the default theme). Here are examples of the button theme pairings in the default theme. All buttons have the same HTML markup:
- +Button can be manually assigned any of the button color swatches from the theme to add visual contrast with the container they sit inside by adding the data-theme attribute on the button markup and specifying a swatch letter.
-<a href="index.html" data-role="button" data-theme="a">Theme a</a>
+
+<a href="index.html" data-role="button" data-theme="a">Theme a</a>
-
+
Here are 4 buttons with icons that have a different swatch letter assigned via the data-theme attribute.
-
+
Theme a
Theme b
Theme c
Theme d
Theme e
-
+
Theme variations
-
+
"a" theme on container with themed buttons inside
-
+
"b" theme on container with themed buttons inside
-
+
"c" theme on container with themed buttons inside
-
+
"d" theme on container with themed buttons inside
-
+
"e" theme on container with themed buttons inside
-
- Buttons that are used for navigation should be coded as anchor links, and those that submit forms as button elements — each will be styled identically by the framework.
In the main content block of a page, you can style any anchor link as a button by adding the data-role="button" to the link. The framework will add all necessary classes to style the link as a button. For example, this markup:
Produces this link-based button:
Link button - +For ease of styling, the framework automatically converts any button element or input with a type of submit, reset, button, or image into a custom styled link-based button — there is no need to add the data-role="button" attribute.
The original form-based button is hidden, but remains in the markup. When a click event fires on a link button, it triggers a click on the original form button.
@@ -43,46 +43,46 @@Button based button:
- +Input type="button" based button:
- +Input type="submit" based button:
- +Input type="reset" based button:
- +Input type="image" based button:
- -To be documented
- +To be documented
- +To be documented
- +To be documented
- - - + + +Collapsible sets start with the exact same markup as individual collapsibles. By adding a parent wrapper with a data-role="collapsible-set" attribute around a number of collapsibles, the framework will style these to looks like a visually grouped widget and make it behave like an accordion so only one section can be open at a time.
By default, all the sections will be collapsed. To set a section to be open when the page loads, add the data-collapsed="false" attribute to the heading of the section you want expanded.
+
<div data-role="collapsible-set">
<div data-role="collapsible" data-collapsed="false">
<h3>Section A</h3>
<p>I'm the collapsible set content for section B.</p>
</div>
-
+
<div data-role="collapsible">
<h3>Section B</h3>
<p>I'm the collapsible set content for section B.</p>
</div>
-
+
</div>
-
-
+
+
Here is an example of a collapsible set with 5 sections.
- +To create a collapsible blocks of content, create a container and add the data-role="collapsible" attribute.
Directly inside this container, add any header element (H1-H6). The framework will style the header to look like a clickable button and add a "+" icon to the left to indicate it's expandable.
- +After the header, add any HTML markup you want to be collapsible. The framework will wrap this markup in a container that will be hidden/shown when the heading is clicked.
-
+
<div data-role="collapsible">
<h3>I'm a header</h3>
<p>I'm the collapsible content. By default I'm open and displayed on the page, but you can click the header to hide me.</p>
</div>
-
-
+
+
As the example notes, by default the content will be collapsed. To expand the content when the page loads, add the data-collapsed="false" attribute to the wrapper.
+
<div data-role="collapsible" data-collapsed="true">
This code will create a collapsible widget like this:
-
+
I'm a header
I'm the collapsible content. I'm expanded by default because I have the "collapsed" state set to false; you need to expand the header to see me.
-
+
Collapsible content is minimally styled — we add only a bit of margin between the bar and content, and the header adopts the default Theme styles of the container it sits within.
Collapsible example
This page has 4 collapsible containers with different types of content inside.
-
+
Section 1: Collapsed text block
I'm closed when the page loads because I have the data-collapsed="true" attribute on my container.
I'm the collapsible content. I'm the collapsible content. I'm the collapsible content. I'm the collapsible content. I'm the collapsible content. I'm the collapsible content. I'm the collapsible content.
-
+
Section 2: Expanded on load
I'm closed when the page loads because I don't have the data-collapsed="false" attribute on my container.
I'm the collapsible content. I'm the collapsible content. I'm the collapsible content. I'm the collapsible content. I'm the collapsible content. I'm the collapsible content.
-
+
Section 3: Form elements
I'm the collapsible content. By default I'm open and displayed on the page, but you can click the header to hide me.
It's possible to combine multiple collapsibles into a grouped sets that acts like an accordion widget. Learn more
- - -Using multiple column layouts isn't generally recommended on a mobile device because of the narrow screen width, but there are times where you may need to place small elements side-by-side (like buttons or navigation tabs, for example).
- +The jQuery Mobile framework provides a simple way to build CSS-based columns through a block style class convention called ui-grid.
There are two preset configurations layouts — two-column (using the class of ui-grid-a), and three-column (using the class of ui-grid-b) — that can be used in any situation that requires columns. Grids are 100% width, completely invisible (no borders or backgrounds) and don't have padding or margins, so they shouldn't interfere with the styles of elements placed inside them.
To build a two-column (50/50%) layout, start with a container with a class of ui-grid-a, and add two child containers inside it classed with ui-block-a for the first column and ui-block-b for the second:
The above markup produces the following content layout:
- +As you see above, by default grid blocks have no visual styling; they simply present content side-by-side.
- +Grid classes can be applied to any container. In this next example, we add ui-grid-a to a fieldset, and apply the ui-block classes to the two buttons inside to stretch them each to 50% of the screen width:
<fieldset class="ui-grid-a">
<div class="ui-block-a"><button type="submit" data-theme="c">Cancel</button></div>
- <div class="ui-block-b"><button type="submit" data-theme="b">Submit</button></div>
+ <div class="ui-block-b"><button type="submit" data-theme="b">Submit</button></div>
</fieldset>
-
+
-
-
+
+
Theme classes (not data-theme attributes) from the theming system can be added to an element, including grids. On the blocks below, we're adding two classes: ui-bar to add the default bar padding and ui-bar-e to apply the background gradient and font styling for the "e" toolbar theme swatch. For illustration purposes, an inline style="height:120px" attribute is also added to each grid to set each to a standard height.
The other grid layout configuration uses class=ui-grid-b on the parent, and 3 child container elements, each with its respective ui-block-a/b/c class, to create a three-column layout (33/33/33%). Note: These blocks are also styled with theme classes so the grid layout is clearly visible.
<div class="ui-grid-b">
<div class="ui-block-a">Block A</div>
@@ -82,37 +82,37 @@ Three-column grids
<div class="ui-block-c">Block C</div>
</div><!-- /grid-b -->
-
+
This will produce a 33/33/33% grid for our content.
- +And an example of a 3 column grid with buttons inside:
- +A four-column, 25/25/25/25% grid is created by specifying class=ui-grid-c on the parent and adding a fourth block. Note: These blocks are also styled with theme classes so the grid layout is clearly visible.
A five-column, 20/20/20/20/20% grid is created by specifying class=ui-grid-d on the parent and adding a fourth block. Note: These blocks are also styled with theme classes so the grid layout is clearly visible.
Grids are designed to wrap to multiple rows of items. For example, if you specify a 3-column grid (ui-grid-b) on a container that has nine child blocks, it will wrap to 3 rows of 3 items each. There is a CSS rule to clear the floats and start a new line when the class=ui-block-a is seen so make sure to assign block classes in a repeating sequence (a, b, c, a, b, c, etc.) that maps to the grid type:
The default approach to styling content in jQuery Mobile is simple: Use a light hand. Our goal is to let the browser's native rendering take precedence; we add a bit of padding for more comfortable readability, and use the theming system to apply the font family and colors.
Taking a light hand with content styling gives designers and developers a clean slate to work with, instead of fighting against a lot of complex style overhead.
- +By default, jQuery Mobile themes use standard HTML styles and sizes for standard markup elements like headers, paragraph content, block quotes, anchor links, standard ordered, unordered and definition lists, and tables — as shown in the examples below:
This is a paragraph that contains strong, emphasized and linked text. Here is more text so you can see how HTML markup works in content. Here is more text so you can see how HTML markup works in content.
- +How about some blockquote action with a cite- +
This is another paragraph of text so you can see how HTML markup works in content. This is another paragraph of text so you can see how HTML markup works in content. This is another paragraph of text so you can see how HTML markup works in content.
- +We add a few styles to tables and fieldsets to make them more legible, which are easily overridden with customs styles.
The main content area of a page (container with the data-role="content" attribute) should be themed by adding the data-theme attribute to the data-role="page" container to ensure that the background colors are applied to the full page, regardless of the content length. (If you add to the data-theme to the content container, the background color will stop after the content so there may be a gap in color between the content and fixed footer.)
<div data-role="page" data-theme="a">
-
+
To set the color of the collapsible header, add the data-theme attribute to the collapsible container. The icon and body are not currently themable through data attributes, but can be styled directly with custom css.
+
<div data-role="collapsible" data-collapsed="true" data-theme="a">
Themed examples
-
+
A theme swatch on content & collapsible
H1 Heading
@@ -45,7 +45,7 @@ I'm an themed collapsible
I have data-theme attribute set manually on my container to set the color to match the content block I'm in.
B theme swatch on content & collapsible
I have data-theme attribute set manually on my container to set the color to match the content block I'm in.
C theme swatch on content & collapsible
I have data-theme attribute set manually on my container to set the color to match the content block I'm in.
D theme swatch on content & collapsible
I have data-theme attribute set manually on my container to set the color to match the content block I'm in.
E theme swatch on content & collapsible
I have data-theme attribute set manually on my container to set the color to match the content block I'm in.
The content of pages in jQuery Mobile is completely open-ended, but the jQuery Mobile framework provides a number of helpful tools and widgets — such as collapsible panels and multiple-column grid layouts — to make it easy to format your content for mobile devices.
- - + +To be documented
- +To be documented
- +To be documented
- +To be documented
- - - + + +Typically, there are multiple checkboxes listed under a question title. To visually integrate multiple checkboxes into a grouped button set, the framework will automatically remove all margins between buttons and round only the top and bottom corners of the set if there is a data-role="controlgroup" attribute on the fie.
Checkboxes can also be used for grouped button sets where more than one button can be selected at once, such as the bold, italic and underline button group seen in word processors. To make a horizontal button set, add the data-type="horizontal" to the fieldset.
@@ -93,7 +93,7 @@ Horizontal toggle sets
The framework will float the labels so they sit side-by-side on a line, hide the checkbox icons and only round the left and right edges of the group.
- +If you manipulate a radiobutton via JavaScript, you must call the refresh method on it to update the visual styling. Here is an example:
$("input[type='checkbox']").attr("checked",true).checkboxradio("refresh");
@@ -118,17 +118,17 @@ Refreshing a checkbox
-
- We're considering adding a refresh method to forms to let the framework refresh all the individual elemnts withing but that is a future enhancement.
- - + +Button based button:
@@ -205,16 +205,16 @@In jQuery Mobile, form submissions are automatically handled using Ajax whenever possible, creating a smooth transition between the form and the result page. To ensure your form submits as intended, be sure to specify action and method properties on your form element. When unspecified, the method will default to get, and the action will default to the current page's relative path (found via $.mobile.path.get()
Forms also accept attributes for transitions just like anchors, such as data-transition="pop" and data-direction="reverse". To submit a form without Ajax, you can either disable Ajax form handling globally, or per form via the data-ajax="false" attribute. The target attribute (as in target="_blank") is respected on forms as well, and will default to the browser's handling of that target when the form submits. Note that unlike anchors, the rel attribute is not allowed on forms.
This demonstrates automated ajax handling of form submissions. The form below is configured to send regular a get request to forms-sample-response.php. On submit, jQuery Mobile will make sure that the Url specified is able to be retrieved via Ajax, and handle it appropriately. Keep in mind that just like ordinary HTTP form submissions, jQuery Mobile allows get result pages to be bookmarked by updating the Url hash when the response returns successfully. Also like ordinary form submissions, post requests do not contain query parameters in the hash, so they are not bookmarkable.
To prevent form submissions from being automatically handled with Ajax, add the data-ajax="false" attribute to the form element. You can also turn of Ajax form handling completely via the ajaxEnabled global config option.
The form below is identical to the one above except for the addition of the data-ajax="false" attribute attribute. When the submit button is pressed, it will result in a full page refresh.
If you manipulate a slider via JavaScript, you must call the refresh method on it to update the visual styling. Here is an example:
@@ -63,16 +63,16 @@ Refreshing a slider
-
-
+
+
-
+
-
+
More in this section
-
+
-
+
- Form elements
- Form basics
- Form element gallery
@@ -87,17 +87,17 @@ More in this section
- Native form elements
- Submitting forms
- Plugin methods
-
+
-
+
-
+
diff --git a/docs/forms/forms-switch.html b/docs/forms/forms-switch.html
index a6ead42f053..b3624a692bb 100755
--- a/docs/forms/forms-switch.html
+++ b/docs/forms/forms-switch.html
@@ -1,17 +1,17 @@
-
-
+
+
-
- jQuery Mobile Docs - Flip switch
-
+
+ jQuery Mobile Docs - Flip switch
+
-
-
+
+
@@ -21,35 +21,35 @@ Flip switch
-
+
-
-
-
+
+
+
-
+
-
+
More in this section
-
+
-
+
- Form elements
- Form basics
- Form element gallery
@@ -84,17 +84,17 @@ More in this section
- Native form elements
- Submitting forms
- Plugin methods
-
+
-
+
-
+
diff --git a/docs/forms/forms-themes.html b/docs/forms/forms-themes.html
index f887b6039ed..991ee33389f 100755
--- a/docs/forms/forms-themes.html
+++ b/docs/forms/forms-themes.html
@@ -1,17 +1,17 @@
-
-
+
+
-
- jQuery Mobile Docs - Theming Forms
-
+
+ jQuery Mobile Docs - Theming Forms
+
-
-
+
+
@@ -22,35 +22,35 @@ Theming forms
-
+
Form themes
- jQuery Mobile has a rich theming system that gives you full control of how pages and forms are styled. By default all form elements inside a container will automaticlaly adopt the same theme color swatch as their parent. This allows form elements to blend into their layouts with minimal work. The data-theme attribute can be applied any individual form element to apply any of the lettered theme color swatches to create contrast and emphasis in your designs.
-
+ jQuery Mobile has a rich theming system that gives you full control of how pages and forms are styled. By default all form elements inside a container will automaticlaly adopt the same theme color swatch as their parent. This allows form elements to blend into their layouts with minimal work. The data-theme attribute can be applied any individual form element to apply any of the lettered theme color swatches to create contrast and emphasis in your designs.
+
All the form elements in the examples below use the same HTML code with no theme swatch specified on the individual form elements. The only difference between each example block code is a data-theme swatch color assigned to each parent container. This illustrates the way form elements automatically adopt the theme swatch of their parent.
-
-
+
+
Body swatch A
-
+
-
+
+
-
+
-
-
+
+
-
+
-
+
-
+
-
+
Body swatch B
@@ -107,7 +107,7 @@ Body swatch B
+
@@ -126,7 +126,7 @@ Body swatch B
-
+
@@ -157,7 +157,7 @@ Body swatch B
-
+
@@ -174,7 +174,7 @@ Body swatch C
+
@@ -193,7 +193,7 @@ Body swatch C
-
+
@@ -224,11 +224,11 @@ Body swatch C
-
+
-
-
-
+
+
+
Body swatch D
@@ -242,7 +242,7 @@ Body swatch D
+
@@ -261,7 +261,7 @@ Body swatch D
-
+
@@ -292,7 +292,7 @@ Body swatch D
-
+
@@ -309,7 +309,7 @@ Body swatch E
+
@@ -328,7 +328,7 @@ Body swatch E
-
+
@@ -359,12 +359,12 @@ Body swatch E
-
+
-
-
+
+
@@ -391,7 +391,7 @@ More in this section
-
+
diff --git a/docs/forms/index.html b/docs/forms/index.html
index 7cf7e2f5c05..7705d86a7b9 100755
--- a/docs/forms/index.html
+++ b/docs/forms/index.html
@@ -1,17 +1,17 @@
-
-
+
+
-
- jQuery Mobile Docs - Forms
-
+
+ jQuery Mobile Docs - Forms
+
-
-
+
+
@@ -21,9 +21,9 @@ Form elements
-
+
All form elements begin with standard html controls that are enhanced to make them more attractive and easy-to-use. In browsers that don't support the custom controls, they will still have a usable experience because these are all based on native form elements.
-
+
- Form basics
- Form element gallery
@@ -39,8 +39,8 @@ Form elements
- Submitting forms
- Plugin methods
-
-
+
+
diff --git a/docs/forms/plugin-eventsmethods.html b/docs/forms/plugin-eventsmethods.html
index f2ab181e930..51520560628 100755
--- a/docs/forms/plugin-eventsmethods.html
+++ b/docs/forms/plugin-eventsmethods.html
@@ -1,17 +1,17 @@
-
-
+
+
-
- jQuery Mobile Docs - Form Plugin Methods
-
+
+ jQuery Mobile Docs - Form Plugin Methods
+
-
-
+
+
@@ -24,155 +24,155 @@ Form Plugin Methods
Form methods reference
After jQuery Mobile auto-enhances form controls into custom controls, you can manipulate many of their properties via plugin methods. The currently available methods are listed below. Check Github for updates - we're working on complete coverage.
-
+
Selectmenu
open open a closed select menu
-
-$('select').selectmenu('open');
+$('select').selectmenu('open');
-
+
close close an open select menu
-
-$('select').selectmenu('close');
+$('select').selectmenu('close');
-
+
refresh: Update the custom menu to reflect the native select element's value.
If the number of options in the select are different than the number of items in the custom menu, it'll rebuild the custom menu. Also, if you pass a true argument you can force the rebuild to happen.
-//refresh value
+//refresh value
$('select').selectmenu('refresh');
//refresh and force rebuild
$('select').selectmenu('refresh', true);
-
+
enable: enable a disabled select.
-
-$('select').selectmenu('enable');
+$('select').selectmenu('enable');
-
+
disable: disable a select.
-
-$('select').selectmenu('disable');
+$('select').selectmenu('disable');
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
Textinput
enable: enable a disabled textinput/textarea.
-
-$('input').textinput('enable');
+$('input').textinput('enable');
-
+
disable: disable a textinput/textarea.
-
-$('textarea').textinput('disable');
+$('textarea').textinput('disable');
-
-
-
-
-
-
-
+
+
+
+
+
+
+
checkboxradio
enable: enable a disabled checkboxradio.
-
-$('input').checkboxradio('enable');
+$('input').checkboxradio('enable');
-
+
disable: disable a checkboxradio.
-
-$('input').checkboxradio('disable');
+$('input').checkboxradio('disable');
-
+
refresh: refresh a checkboxradio's value.
-
-$('input').checkboxradio('refresh');
+$('input').checkboxradio('refresh');
-
-
-
- Slider
+
+
+
+ Slider
enable: enable a disabled slider.
-
-$('input').slider('enable');
+$('input').slider('enable');
-
+
disable: disable a slider.
-
-$('input').slider('disable');
+$('input').slider('disable');
-
+
refresh: refresh a slider's value.
-
-$('input').slider('refresh');
+$('input').slider('refresh');
-
-
- Form buttons
+
+
+ Form buttons
enable: enable a disabled button.
-
-$('input').button('enable');
+$('input').button('enable');
-
+
disable: disable a slider.
-
-$('input').button('disable');
+$('input').button('disable');
-
-
+
+
Degraded Form Input Types
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 themable search input styling.
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).
-
- You can configure which types are changed via the page plugin's degradeInputs option, which can be manipulated externally via $.mobile.page.prototype.options.degradeInputs, 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 mobileinit event, so that it applies to the first page as well as subsequent pages that are loaded.
-
+
+ You can configure which types are changed via the page plugin's degradeInputs option, which can be manipulated externally via $.mobile.page.prototype.options.degradeInputs, 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 mobileinit event, so that it applies to the first page as well as subsequent pages that are loaded.
+
@@ -199,7 +199,7 @@ More in this section
-
+
diff --git a/docs/forms/radiobuttons/events.html b/docs/forms/radiobuttons/events.html
index bad3a34e9d1..b1af1aa7153 100644
--- a/docs/forms/radiobuttons/events.html
+++ b/docs/forms/radiobuttons/events.html
@@ -26,25 +26,25 @@ Radio buttons
+
The radio button plugin has the following custom events:
create triggered when a radio button is createdThis event is used to find out when a custom radio button was created. It is not used to create a custom radio button. The radio button create event can be used like this:
@@ -52,24 +52,24 @@
$("input[type='radio']").checkboxradio({
create: function(event, ui) { ... }
-});
+});
Lists are used for data display, navigation, result lists, and data entry so jQuery Mobile includes a wide range of list types and formatting examples to cover most common design patterns.
- +
France 4
Norway 328
United States 62You've been invited to a meeting at Filament Group in Boston, MA
Hey Stephen, if you're available at 10am tomorrow, we've got a meeting with the jQuery team.
6:24PM
- +Boston Conference Planning
In preparation for the upcoming conference in Boston, we need to start gathering a list of sponsors and speakers.
9:18AM
- +6:24AM
Germany 4
Great Britain 0
Finland 12
Norway 328
United States 62
France 4
Norway 328
United States 62All your favorites from aarkvarks to zebras.
- +Fresh colors from the magic rainbow.
- +Everything from cars to planes.
- +9:18AM
France 4
Norway 328
United States 62Phoenix
Here is a variety of full-width lists that are read-only. If a list has the data-role="listview" attribute, but the contents aren't linked, it will display as read-only. These look like normal lists, but don't have a right arrow.
-
+
9:18AM
France 4
Norway 328
United States 62Phoenix
All the standard button swatches can be applied to lists. The framework assigns a default list theme swatch of "c" (silver in the default theme) and swatch "b" (blue in default theme) for dividers. Below is a default themed list.
- +
<ul data-role="listview" data-inset="true">
@@ -34,23 +34,23 @@ The list item color scheme can be changed to any button color theme swatch by adding the data-theme attribute to the list, and setting the letter theme swatch. Here is the same list above with the "a" swatch applied.
<ul data-role="listview" data-inset="true" data-theme="d">
-
+
-
+
data-theme attributes also work at the LI-level, for styling a single item.
- + - +The theme for list dividers can be set by adding the data-divider-theme to the list and specifying a swatch letter. Here is an example of the same list above with swatch "d" set on the dividers.
<ul data-role="listview" data-inset="true" data-theme="d" data-divider-theme="e">
-
+
-
+
The theme for count bubbles can be set by adding the data-count-theme to the list and specifying a swatch letter. Here is an example with swatch "e" set on the dividers.
<ul data-role="listview" data-inset="true" data-theme="d" data-divider-theme="e" data-count-theme="b">
-
+
-
+
The default icon for each list item is arrow-r. To override this, set the data-icon attribute on the desired list item to the name of a standard icon. To prevent icons from appearing altogether, set the data-icon attribute to "false".
@@ -105,12 +105,12 @@ Theming icons
- Alerts
- No icon
-
-
+
+
Theming split buttons
-
+
For split lists which a second button, the framework default to "b" for the theme swatch (blue in the default theme) Here is a default split list:
-
+
-
+
<ul data-role="listview" data-inset="true" data-split-theme="a">
@@ -148,7 +148,7 @@ Warning
The icon for the split theme can set at the list level by adding the data-split-icon to the list and specifying a standard icon. This attribute can also be added to individual split inside list items by adding a data-icon attribute to specific links (see second list item).
-
+
<ul data-role="listview" data-inset="true" data-split-theme="d" data-split-icon="delete">
@@ -171,46 +171,46 @@ Warning
-
+
Examples of all basic list swatches
-
+
A swatch
-
+
B swatch
-
+
C swatch
-
+
D swatch
-
+
E swatch
-
-
- To be documented
- +To be documented
- +To be documented
- +To be documented
- - - + + +This is a regular page, styled as a dialog. To create a dialog, just link to a normal page and include a transition and data-rel="dialog" attribute.
This is a regular page, styled as a dialog. To create a dialog, just link to a normal page and include a transition and data-rel="dialog" attribute.
" + category.description + "
jQuery Mobile includes automatic AJAX page loading of external pages with back button history support, a set of animated page transitions and simple tools for displaying pages as dialogs.
- +I have an id of "one" on my page container. I'm first in the source order so I'm shown when the page loads.
- -This is a multi-page boilerplate template that you can copy to build you first jQuery Mobile page. This template contains multiple "page" containers inside, unlike a single page template that has just one page within it.
+ +I have an id of "one" on my page container. I'm first in the source order so I'm shown when the page loads.
+ +This is a multi-page boilerplate template that you can copy to build you first jQuery Mobile page. This template contains multiple "page" containers inside, unlike a single page template that has just one page within it.
Just view the source and copy the code to get started. All the CSS and JS is linked to the jQuery CDN versions so this is super easy to set up. Remember to include a meta viewport tag in the head to set the zoom level.
-You link to internal pages by referring to the ID of the page you want to show. For example, to link to the page with an ID of "two", my link would have a href="#two" in the code.
You link to internal pages by referring to the ID of the page you want to show. For example, to link to the page with an ID of "two", my link would have a href="#two" in the code.
I have an id of "two" on my page container. I'm the second page container in this multi-page template.
-Notice that the theme is different for this page because we've added a few data-theme swatch assigments here to show off how flexible it is. You can add any content or widget to these pages, but we're keeping these simple.
I have an id of "two" on my page container. I'm the second page container in this multi-page template.
+Notice that the theme is different for this page because we've added a few data-theme swatch assigments here to show off how flexible it is. You can add any content or widget to these pages, but we're keeping these simple.
I have an id of "popup" on my page container and only look like a dialog because the link to me had a data-rel="dialog" attribute which gives me this inset look and a data-transition="pop" attribute to change the transition to pop. Without this, I'd be styled as a normal page.
I have an id of "popup" on my page container and only look like a dialog because the link to me had a data-rel="dialog" attribute which gives me this inset look and a data-transition="pop" attribute to change the transition to pop. Without this, I'd be styled as a normal page.
The jQuery Mobile "page" structure is optimized to support either single pages, or local internal linked "pages" within a page.
- -The goal of this model is to allow developers to create websites using best practices — where ordinary links will "just work" without any special configuration — while creating a rich, native-like experience that can't be achieved with standard HTTP requests.
+The jQuery Mobile "page" structure is optimized to support either single pages, or local internal linked "pages" within a page.
-The goal of this model is to allow developers to create websites using best practices — where ordinary links will "just work" without any special configuration — while creating a rich, native-like experience that can't be achieved with standard HTTP requests.
-A jQuery Mobile site must start with an HTML5 'doctype' to take full advantage of all of the framework's features. (Older devices with browsers that don't understand HTML5 will safely ignore the 'doctype' and various custom attributes.) In the 'head', references to jQuery, jQuery Mobile and the mobile theme CSS are all required to start things off. We recommend linking to the files hosted on the jQuery CDN for best performance:
+A jQuery Mobile site must start with an HTML5 'doctype' to take full advantage of all of the framework's features. (Older devices with browsers that don't understand HTML5 will safely ignore the 'doctype' and various custom attributes.) In the 'head', references to jQuery, jQuery Mobile and the mobile theme CSS are all required to start things off. We recommend linking to the files hosted on the jQuery CDN for best performance:
-<!DOCTYPE html>
-<html>
- <head>
- <title>Page Title</title>
-
- <meta name="viewport" content="width=device-width, initial-scale=1">
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Page Title</title>
+
+ <meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0b3/jquery.mobile-1.0b3.min.css" />
<script type="text/javascript" src="http://code.jquery.com/jquery-1.6.3.min.js"></script>
<script type="text/javascript" src="http://code.jquery.com/mobile/1.0b3/jquery.mobile-1.0b3.min.js"></script>
-</head>
+</head>
-<body>
+<body>
...content goes here...
</body>
</html>
-
+
Note above that there is a meta viewport tag in the head to specify how the browser should display the page zoom level and dimensions. If this isn't set, many mobile browsers will use a "virtual" page width around 900 pixels to make it work well with exisitng desktop sites but the screens may look zoomed out and too wide. By setting the viewport attributes to content="width=device-width, initial-scale=1, the width will be set to the pixel width of the device screen.
<meta name="viewport" content="width=device-width, initial-scale=1">
-
+
These settings do not disable the user's ability to zoom the pages which is nice from an accessibility perspective. There is a minor issue in iOS that doesn't properly set the width when changing orientations with these viewport settings, but this will hopefully be fixed a a future release. You can set other viewport values to disable zooming if required since this is part of your page content, not the library.
- +Inside the <body> tag, each view or "page" on the mobile device is identified with an element (usually a div) with the data-role="page" attribute:
Inside the <body> tag, each view or "page" on the mobile device is identified with an element (usually a div) with the data-role="page" attribute:
<div data-role="page">
+
+<div data-role="page">
...
-</div>
-
-
+</div>
+
+Within the "page" container, any valid HTML markup can be used, but for typical pages in jQuery Mobile, the immediate children of a "page" are divs with data-roles of "header", "content", and "footer".
Within the "page" container, any valid HTML markup can be used, but for typical pages in jQuery Mobile, the immediate children of a "page" are divs with data-roles of "header", "content", and "footer".
<div data-role="page">
- <div data-role="header">...</div>
- <div data-role="content">...</div>
- <div data-role="footer">...</div>
-</div>
-
-<div data-role="page">
+ <div data-role="header">...</div>
+ <div data-role="content">...</div>
+ <div data-role="footer">...</div>
+</div>
+
+Putting it all together, this is the standard boilerplate page template you should start with on a project. :
-<!DOCTYPE html>
-<html>
- <head>
- <title>Page Title</title>
-
- <meta name="viewport" content="width=device-width, initial-scale=1">
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Page Title</title>
+
+ <meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0b3/jquery.mobile-1.0b3.min.css" />
<script type="text/javascript" src="http://code.jquery.com/jquery-1.6.3.min.js"></script>
<script type="text/javascript" src="http://code.jquery.com/mobile/1.0b3/jquery.mobile-1.0b3.min.js"></script>
-</head>
-<body>
+</head>
+<body>
<div data-role="page">
@@ -102,8 +102,8 @@ Putting it together: Basic single page template
<h1>Page Title</h1>
</div><!-- /header -->
- <div data-role="content">
- <p>Page content goes here.</p>
+ <div data-role="content">
+ <p>Page content goes here.</p>
</div><!-- /content -->
<div data-role="footer">
@@ -118,14 +118,14 @@ Putting it together: Basic single page template
View boilerplate template
- Multi-page template structure
-
- A single HTML document can contain multiple 'pages' that are loaded together by stacking multiple divs with a data-role of "page". Each 'page' block needs a unique ID (id="foo") that will be used to link internally between 'pages' (href="#foo"). When a link is clicked, the framework will look for an internal 'page' with the ID and transition it into view.
-
- Here is an example of a 2 "page" site built with two jQuery Mobile divs navigated by linking to an ID placed on each page wrapper. Note that the IDs on the page wrappers are only needed to support the internal page linking, and are optional if each page is a separate HTML document. Here is what two pages look inside the body element.
+ Multi-page template structure
+
+ A single HTML document can contain multiple 'pages' that are loaded together by stacking multiple divs with a data-role of "page". Each 'page' block needs a unique ID (id="foo") that will be used to link internally between 'pages' (href="#foo"). When a link is clicked, the framework will look for an internal 'page' with the ID and transition it into view.
+
+ Here is an example of a 2 "page" site built with two jQuery Mobile divs navigated by linking to an ID placed on each page wrapper. Note that the IDs on the page wrappers are only needed to support the internal page linking, and are optional if each page is a separate HTML document. Here is what two pages look inside the body element.
-<body>
+<body>
<!-- Start of first page -->
<div data-role="page" id="foo">
@@ -134,9 +134,9 @@ Multi-page template structure
<h1>Foo</h1>
</div><!-- /header -->
- <div data-role="content">
- <p>I'm first in the source order so I'm shown as the page.</p>
- <p>View internal page called <a href="#bar">bar</a></p>
+ <div data-role="content">
+ <p>I'm first in the source order so I'm shown as the page.</p>
+ <p>View internal page called <a href="#bar">bar</a></p>
</div><!-- /content -->
<div data-role="footer">
@@ -152,9 +152,9 @@ Multi-page template structure
<h1>Bar</h1>
</div><!-- /header -->
- <div data-role="content">
- <p>I'm first in the source order so I'm shown as the page.</p>
- <p><a href="#foo">Back to foo</a></p>
+ <div data-role="content">
+ <p>I'm first in the source order so I'm shown as the page.</p>
+ <p><a href="#foo">Back to foo</a></p>
</div><!-- /content -->
<div data-role="footer">
@@ -162,25 +162,25 @@ Multi-page template structure
</div><!-- /footer -->
</div><!-- /page -->
</body>
-
+
View multi-page template
- +
PLEASE NOTE: Since we are using the hash to track navigation history for all the Ajax 'pages', it's not currently possible to deep link to an anchor (index.html#foo) on a page in jQuery Mobile, because the framework will look for a 'page' with an ID of #foo instead of the native behavior of scrolling to the content with that ID.
Although the page structure outlined above is a recommended approach for a standard web app built with jQuery Mobile, the framework is very flexible with document structure. The page, header, content, and footer data-role elements are optional and are mostly helpful for providing some basic formatting and structure. The page wrapper used to be required for auto-initialization to work but this too is now optional for single page documents so there isn't any required markup at all. For a web page with a custom layout, all of these structural elements can be omitted but the Ajax navigation and all widgets will work just like they do in the boilerplate structure. Behind the scenes, the framework will inject the page wrapper if it's not included in the markup because it’s needed for managing pages, but the starting markup can now be extremely simple.
Note that in a multi-page setup, you are required to have page wrappers in your markup in order to group the content into multiple pages.
- -Usually, it's a good idea to store your app's pages in several single-page templates instead of one large multi-page template. This minimizes the size of the page's DOM.
When using single-page templates, you can prefetch pages into the DOM so that they're available instantly when the user visits them. To prefetch a page, add the data-prefetch attribute to a link that points to the page. jQuery Mobile then loads the target page in the background after the primary page has loaded and the pagecreate event has triggered. For example:
<a href="prefetchThisPage.html" data-prefetch> ... </a>
@@ -41,8 +41,8 @@
$.mobile.loadPage( pageUrl );
-
- Another advantage of prefetching a page is that the user doesn't see the Ajax loading message when visiting the prefetched page. The Ajax loading message only appears if the framework hasn't finished prefetching the page by the time the link is followed.
+ +Another advantage of prefetching a page is that the user doesn't see the Ajax loading message when visiting the prefetched page. The Ajax loading message only appears if the framework hasn't finished prefetching the page by the time the link is followed.
Prefetching pages naturally creates additional HTTP requests and uses bandwidth, so it's wise to use this feature only in situations where it's highly likely that the prefetched page will be visited. A common scenario is a photo gallery, where you can prefetch the "previous" and "next" photo pages so that the user can move quickly between photos.
@@ -52,7 +52,7 @@For animated page transitions to work, the pages you're transitioning from and to both need to be in the DOM. However, keeping old pages in the DOM quickly fills the browser's memory, and can cause some mobile browsers to slow down or even crash.
jQuery Mobile therefore has a simple mechanism to keep the DOM tidy. Whenever it loads a page via Ajax, jQuery Mobile flags the page to be removed from the DOM when you navigate away from it later (technically, on the pagehide event). If you revisit a removed page, the browser may be able to retrieve the page's HTML file from its cache. If not, it refetches the file from the server. (In the case of nested list views, jQuery Mobile removes all the pages that make up the nested list once you navigate to a page that's not part of the list.)
- +Pages inside a multi-page template aren't affected by this feature at all - jQuery Mobile only removes pages loaded via Ajax.
@@ -81,7 +81,7 @@The drawback of DOM caching is that the DOM can get very large, resulting in slowdowns and memory issues on some devices. If you enable DOM caching, take care to manage the DOM yourself and test thoroughly on a range of devices.
-By default, the dialog will open with a 'pop' transition. Like all pages, you can specify any page transition you want on the dialog by adding the data-transition attribute to the link. To make it feel more dialog-like, we recommend specifying a transition of "pop", "slideup" or "flip".
<a href="foo.html" data-rel="dialog" data-transition="pop">Open dialog</a>
-
+
-
-
+
+
When any link is clicked within in a dialog, the framework will automatically close the dialog and transition to the requested page, just as if the dialog were a normal page. To create a "cancel" button in a dialog, just link to the page that triggered the dialog to open and add the data-rel="back" attribute to your link. This pattern of linking to the previous page is also usable in non-JS devices as well.
For JavaScript-generated links, you can simply set the href attribute to "#" and use the data-rel="back" attribute. You can also call the dialog's close() method to programmatically close dialogs, for example: $('.ui-dialog').dialog('close').
Just like the page plugin, you can set a dialog's close button text through option or data attribute. The option can be configured for all dialogs by binding to the mobileinit event and setting the $.mobile.dialog.prototype.options.closeBtnText property to a string of your choosing, or you can place the data attribute data-close-btn-text to configure the text from your markup.
Since dialogs are typically used to support actions within a page, the framework does not include dialogs in the hash state history tracking. This means that dialogs will not appear in your browsing history chronology when the Back button is clicked. For example, if you are on a page, click a link to open a dialog, close the dialog, then navigate to another page, if you were to click the browser's Back button at that point you will navigate back to the first page, not the dialog.
- +Dialogs can be styled with different themes, just like any page. Here is a different dialog design:
An alternate color scheme - - + +And dialogs can be can used more like a control sheet to offer multiple buttons by removing the header:
Share photos... - - -jQuery Mobile is designed to work with simple page linking conventions. Essentially, you can link pages and assets as you normally would, and jQuery Mobile will automatically handle page requests in a single-page model, using Ajax when possible. When Ajax isn't possible (such as a non-same-domain url, or if specified using certain attributes on the link), a normal http request is used instead.
-The goal of this model is to allow developers to create websites using best practices — where ordinary links will "just work" without any special configuration — while creating a rich, native-like experience that can't be achieved with standard HTTP requests.
- -jQuery Mobile is designed to work with simple page linking conventions. Essentially, you can link pages and assets as you normally would, and jQuery Mobile will automatically handle page requests in a single-page model, using Ajax when possible. When Ajax isn't possible (such as a non-same-domain url, or if specified using certain attributes on the link), a normal http request is used instead.
+ +The goal of this model is to allow developers to create websites using best practices — where ordinary links will "just work" without any special configuration — while creating a rich, native-like experience that can't be achieved with standard HTTP requests.
+ +To enable animated page transitions, all links that point to an external page (ex. products.html) will be loaded via Ajax. To do this unobtrusively, the framework parses the link's href to formulate an Ajax request (Hijax) and displays the loading spinner. All this happens automatically by jQuery Mobile.
If the Ajax request is successful, the new page content is added to the DOM, all mobile widgets are auto-initialized, then the new page is animated into view with a page transition.
- +If the Ajax request fails, the framework will display a small error message overlay (styled in the "e" swatch) that disappears after a brief time so this doesn't break the navigation flow. View an example of the error message.
Links that point to other domains or that have rel="external", data-ajax="false" or target attributes will not be loaded with Ajax. Instead, these links and will cause a full page refresh with no animated transition. Both attributes have the same effect, but different semanic meaning. rel="external" should be used when linking to another site or domain, while data-ajax="false" is useful for simply opting a page within your domain from being loaded via Ajax. Because of security restrictions, the framework always opts links to external domains out of the Ajax behavior.
A single HTML document can contain or multiple 'page' containers simply be stacking multiple divs with a data-role of "page". This allows you to build a small site or application within a single HTML document; jQuery Mobile will simply display the first 'page' it finds in the source order when the page loads.
A single HTML document can contain or multiple 'page' containers simply be stacking multiple divs with a data-role of "page". This allows you to build a small site or application within a single HTML document; jQuery Mobile will simply display the first 'page' it finds in the source order when the page loads.
If a link in a multi-page document points to an anchor (#foo), the framework will looks for a page wrapper with that ID (id="foo"). If it finds a page in the HTML document, it will transition the new page into view. You can seamlessly navigate between local, internal "pages" and external pages in jQuery Mobile. Both will look the same to the end user except that external pages will display the Ajax spinner while loading. In either situation, jQuery Mobile updates the page's URL hash to enable Back button support, deep-linking and bookmarking.
It's important to note if you are linking from a mobile page that was loaded via Ajax to a page that contains multiple internal pages, you need to add a rel="external" or data-ajax="false" to the link. This tells the framework to do a full page reload to clear out the Ajax hash in the URL. This is critical because Ajax pages use the hash (#) to track the Ajax history, while multiple internal pages use the hash to indicate internal pages so there will be conflicts in the hash between these two modes.
For example, a link to a page containing multiple internal pages would look like this:
- +<a href="multipage.html" rel="external">Multi-page link</a>
-
+
If you use the attribute data-rel="back" on an anchor, any clicks on that anchor will mimic the back button, going back one history entry and ignoring the anchor's default href. This is particularly useful when linking back to a named page, such as a link that says "home", or when generating "back" buttons with JavaScript, such as a button to close a dialog. When using this feature in your source markup, be sure to provide a meaningful href that actually points to the URL of the referring page (this will allow the feature to work for users in C-Grade browsers. Also, please keep in mind that if you just want a reverse transition without actually going back in history, you should use the data-direction="reverse" attribute instead.
When linking to directory indexes (such as href="typesofcats/" instead of href="typesofcats/index.html"), you must provide a trailing slash. This is because jQuery Mobile assumes the section after the last "/" character in a url is a filename, and it will remove that section when creating base urls from which future pages will be referenced.
- +However, you can work around this issue by returning your page div with a data-url attribute already specified. When you do this, jQuery Mobile will use that attribute's value for updating the URL, instead of the url used to request that page. This also allows you to return urls that change as the result of a redirect, for example, you might post a form to "/login.html" but return a page from the url "/account" after a successful submission. This tool allows you to take control of the jQuery Mobile history stack in these situations. Here's an example:
The following link points to "docs-links-urltest/index.html": Test Link which is a directory with an index page. The return page will update the hash as "/docs/pages/docs-links-urltest/" with a trailing slash. This is done via the data-url attribute in that page's source. Keep in mind that the value will replace the entire hash, and it is up to you to replace it with a URL that actually resolves to the correct page when requested via refresh or deep link.
- +Learn more about the technical details of the navigation model and Ajax, hashes and history in jQuery mobile.
- - - + + +All standard HTML link types are supported in jQuery Mobile in addition to the types outlined above. Here is a sampler of many common link types:
- +Since jQuery Mobile uses an Ajax-powered navigation system, there are a few helpful things to know when writing scripts that interact with the page and navigation model. You can explore the mobile API in more detail by reading up on global configuration options, events, and methods or dig into the technical details of the Ajax navigation model.
- -Since jQuery Mobile uses an Ajax-powered navigation system, there are a few helpful things to know when writing scripts that interact with the page and navigation model. You can explore the mobile API in more detail by reading up on global configuration options, events, and methods or dig into the technical details of the Ajax navigation model.
+ +When you click a link in jQuery Mobile, the Ajax navigation system uses the link's href to formulate an Ajax request. Although the full page is loaded with Ajax, the framework only pulls in the contents of the page, and ignores anything in the head except for title tag contents.
This means that any scripts or styles in the head of the page won't have any effect when the page is loaded via Ajax. The same page will work as expected if you were to load a page directly but both scenarios need to be considered. The reason that the head is ignored for Ajax page content: it's just too complex. The framework would need to compare and reconcile the contents of multiple page head elements as they are loaded into the DOM so we leave this task to the developer.
The simplest approach is to add the same set of stylesheets and scripts into all your pages. If you need to load in specific scripts or styles for a particular page, bind to the pagecreate event (details below) to run the necessary code when a specific page ID is created. Following this approach will ensure that the code executes if the page is loaded directly or is pulled in and shown via Ajax.
The first thing you learn in jQuery is to call code inside the $(document).ready() function so everything will execute as soon as the DOM is loaded. However, in jQuery Mobile, Ajax is used to load the contents of each page into the DOM as you navigate, and the DOM ready handler only executes for the first page. To execute code whenever a new page is loaded and created by the Ajax navigation system, you must bind to the pagecreate event.
The pagecreate event is triggered on the page being initialized, right after initialization occurs. We recommend binding to this event instead of DOM ready() because this will work regardless of whether the page is loaded directly or if the content is pulled into another page as part of the Ajax navigation system.
If you need to change the current page with JavaScript, use the changePage method. There are a lot of methods and properties that you can set when changing pages, but here are two simple examples:
-//transition to the "about us" page with a slideup transition
-$.mobile.changePage( "about/us.html", { transition: "slideup"} );
+//transition to the "about us" page with a slideup transition
+$.mobile.changePage( "about/us.html", { transition: "slideup"} );
-//transition to the "search results" page, using data from a form with an ID of "search""
+//transition to the "search results" page, using data from a form with an ID of "search""
$.mobile.changePage( "searchresults.php", {
- type: "post",
+ type: "post",
data: $("form#search").serialize()
-});
+});
- To load an external page, enhance its content, and insert it into the DOM, use the loadPage method. There are a lot of methods and properties that you can set when loading pages, but here is a simple example:
-//load the "about us" page into the DOM
-$.mobile.loadPage( "about/us.html" );
+//load the "about us" page into the DOM
+$.mobile.loadPage( "about/us.html" );
- The page plugin dispatches a “pagecreate” event, which most widgets use to auto-initialize themselves. As long as a widget plugin script is referenced, it will automatically enhance any instances of the widgets it finds on the page.
-However, if you generate new markup client-side or load in content via Ajax and inject it into a page, you can trigger the create event to handle the auto-initialization for all the plugins contained within the new markup. This can be triggered on any element (even the page div itself), saving you the task of manually initializing each plugin (listview button, select, etc.).
For example, if a block of HTML markup (say a login form) was loaded in through Ajax, trigger the create event to automatically transform all the widgets it contains (inputs and buttons in this case) into the enhanced versions. The code for this scenario would be:
The page plugin dispatches a “pagecreate” event, which most widgets use to auto-initialize themselves. As long as a widget plugin script is referenced, it will automatically enhance any instances of the widgets it finds on the page.
+However, if you generate new markup client-side or load in content via Ajax and inject it into a page, you can trigger the create event to handle the auto-initialization for all the plugins contained within the new markup. This can be triggered on any element (even the page div itself), saving you the task of manually initializing each plugin (listview button, select, etc.).
For example, if a block of HTML markup (say a login form) was loaded in through Ajax, trigger the create event to automatically transform all the widgets it contains (inputs and buttons in this case) into the enhanced versions. The code for this scenario would be:
$( ...new markup that contains widgets... ).appendTo( ".ui-page" ).trigger( "create" );
-
+
- Note that there is an important difference between the create event and refresh method that some widgets have. The create event is suited for enhancing raw markup that contains one or more widgets. The refresh method should be used on existing (already enhanced) widgets that have been manipulated programmatically and need the UI be updated to match.
Note that there is an important difference between the create event and refresh method that some widgets have. The create event is suited for enhancing raw markup that contains one or more widgets. The refresh method should be used on existing (already enhanced) widgets that have been manipulated programmatically and need the UI be updated to match.
For example, if you had a page where you dynamically appended a new unordered list with data-role=listview attribute after page creation, triggering create on a parent element of that list would transform it into a listview styled widget. If more list items were then programmatically added, calling the listview’s refresh method would update just those new list items to the enhanced state and leave the existing list items untouched.
Since we use the URL hash to preserve Back button behavior, using page anchors to jump down to a position on the page isn't supported by using the traditional anchor link (#foo). Use the silentScroll method to scroll to a particular Y position without triggering scroll event listeners. You can pass in a yPos arguments to scroll to that Y location. For example:
-//scroll to Y 300px
-$.mobile.silentScroll(300);
-
-
- One inportant consideration in mobile is handling mouse and touch events. These events differ significantly across mobile platforms, but the common denominator is that click events will work everywhere, but usually after a significant delay of 500-700ms. This delay is necessary for the browser to wait for double tap, scroll and extended hold tap events to potentially occur. To avoid this delay, it's possible to bind to touch events (ex. touchstart) but the issue with this approach is that some mobile platforms (WP7, Blackberry) don't support touch. To compound this issue, some platforms will emit both touch and mouse events so if you bind to both types, duplicate events will be fired for a single interaction.
Our solution is to create a set of virtual events that normalize 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. This still retains the order of event firing in the traditional mouse environment, should multiple handlers be registered on the same element for different events. The virtual mouse system exposes the following virtual events to jQuery bind methods: vmouseover, vmousedown, vmousemove, vmouseup, vclick, and vmousecancel
This is a single page boilerplate template that you can copy to build you first jQuery Mobile page. Each link or form from here will pull a new page in via Ajax to support the animated page transitions.
+This is a single page boilerplate template that you can copy to build you first jQuery Mobile page. Each link or form from here will pull a new page in via Ajax to support the animated page transitions.
Just view the source and copy the code to get started. All the CSS and JS is linked to the jQuery CDN versions so this is super easy to set up. Remember to include a meta viewport tag in the head to set the zoom level.
This template is standard HTML document with a single "page" container inside, unlike a multi-page template that has multiple pages within it. We strongly recommend building your site or app as a series of separate pages like this because it's cleaner, more lightweight and works better without JavaScript.
When you load the first page of a jQuery Mobile based site, then click a link or submit a form, the jQuery Mobile uses Ajax to pull in the content of the requested page. Having both pages in the DOM is essential to enable the animated page transitions, but one downside of this approach is that the page title is always that of the first page, not the subsequent page you’re viewing.
-To remedy this, jQuery Mobile automatically parses the title of the page pulled via Ajax and changes the title attribute of the parent document to match.
To remedy this, jQuery Mobile automatically parses the title of the page pulled via Ajax and changes the title attribute of the parent document to match.
On multi-page documents, we follow a similiar convention, but since all the page share a common title, we have a data-title attribute that can be added each page container within a multi-page template to manually define a title. The title of the HTML docuemnt will be automatically updated to match the data-title of the page currently in view.
<div data-role="page" id="foo" data-title="Page Foo">
@@ -39,7 +39,7 @@ Titles in multi-page templates
- The jQuery Mobile framework includes a set of six CSS-based transition effects that can be applied to any object or page change event, which apply the chosen transition when navigating to a new page and the reverse transition for the Back button. By default, the framework applies the right to left slide transition.
@@ -40,16 +40,16 @@NOTE: The flip transition isn't rendered correctly on most versions of Android because it lacks 3D CSS transform capabilities. Unfortunately, instead of ignoring the flip, Android makes the page "cartwheel" away by rotating instead of flipping. We recommend using this transition sparingly until support improves.
In addition, you can also force a "backwards" transition by specifying data-direction="reverse" on your link. Note: (this was formerly data-back="true", which will remain supported until 1.0)
Transitions from jQtouch (with small modifications): Built by David Kaneda and maintained by Jonathan Stark.
jQuery Mobile has a rich theming system that gives you full control of how pages are styled. There is detailed theming documentation within each page widget, but let's look at a few high-level examples of how theming is applied.
- +The data-theme attribute can be applied to the header and footer containers to apply any of the lettered theme color swatches. While the data-theme attribute could be added to the content container, we recommend adding it instead to div or container that has been assigned the data-role="page" attribute to ensure that the background color is applied to the full page.
The default Theme mixes styles from multiple swatches to create visual texture and present the various elements in optimal contrast to one another:
- +And each of the five "swatches" applies its style consistently across all page elements, as shown below:
- +To be documented
- +To be documented
- +To be documented
- +To be documented
- +This is a demo of the "fixed" headers and footers used in the jQuery Mobile framework. The page content flows naturally, allowing us to take advantage of native scrolling instead of a scripting a faux-scrolling workaround. The header and footer divs are right in the flow of the document, but whenever they are out of view, you can tap the screen to make them appear. Tapping again or scrolling the page will cause them to appear back in the flow of the page (at the top and bottom).
To set this behavior on a header or footer, add the data-position="fixed" attribute to the toolbar container.
<div data-role="header" data-position="fixed">
<h1>Fixed toolbars</h1>
</div>
-
+
+
+
+
-
-
-
Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui.Donec non enim in turpis pulvinar facilisis. Ut felis.
Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui.Donec non enim in turpis pulvinar facilisis. Ut felis.
Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui.Donec non enim in turpis pulvinar facilisis. Ut felis.
Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui.Donec non enim in turpis pulvinar facilisis. Ut felis.
Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui.Donec non enim in turpis pulvinar facilisis. Ut felis.
-
+
This page demonstrates the "fullscreen" toolbar mode. This toolbar treatment is used in special cases where you want the content to fill the whole screen, and you want the header and footer toolbars to appear and disappear when the page is clicked responsively — a common scenario for photo, image or video viewers.
- +To enable this toolbar feature type, you apply a data-fullscreen="true" attribute to the div contain that has the attribute data-role="page", and the data-position="fixed" attribute to both the header and footer div elements.
Keep in mind that the toolbars in this mode will sit over page content, so not all content will be accessible with the toolbars open, just as shown in this demo.
- -Both the header and footer bars will be styled by default with the theme's "a" color swatch (black in the default theme) because these bars are typically primary in the visual hierarchy of a page.
- - + +To set the header or footer bars to a different color in your theme, add the data-theme attribute and specify the letter of the theme swatch (a, b, c, etc.). For example, this will set the bar to swatch "b" (blue in the default theme):
To set the header or footer bars to a different color in your theme, add the data-theme attribute and specify the letter of the theme swatch (a, b, c, etc.). For example, this will set the bar to swatch "b" (blue in the default theme):
-<div data-role="header" data-theme="b">
- <h1>Page Title</h1>
-</div>
-
+<div data-role="header" data-theme="b">
+ <h1>Page Title</h1>
+</div>
+
Any link added inside the header block will be automatically styled as a button that matches the color of the bar's theme swatch. To make a button stand out as a primary call to action, the data-theme attribute can be used to specify a contrasting button color from a different theme swatch. For example, if we set the header to theme "c" (light gray), both buttons would be styled as the "c" button by default. If we wanted the Save button to visually pop, we can override the color by setting the data-theme attribute to "b" (blue in our default theme) on the Save button's anchor.
Any link added inside the header block will be automatically styled as a button that matches the color of the bar's theme swatch. To make a button stand out as a primary call to action, the data-theme attribute can be used to specify a contrasting button color from a different theme swatch. For example, if we set the header to theme "c" (light gray), both buttons would be styled as the "c" button by default. If we wanted the Save button to visually pop, we can override the color by setting the data-theme attribute to "b" (blue in our default theme) on the Save button's anchor.
-<a href="add-user.php" data-theme="b">Save</a>
-
-This is a demo of the variation that can be achieved by tweaking the theme swatches and buttons inside the headers and footers.
In jQuery Mobile, there are two standard types of toolbars: Headers and Footers.
- +It's very common to have a horizontal navigation or tab bar inside the header an/or footer; jQuery Mobile includes a nav bar widget that turns an unordered list of links into a horizontal button bar, which works well in these instances.
- +Header and footers can be positioned on the page in a few different ways. By default, the toolbars use the "inline" positioning mode. In this mode, the headers and footer sit in the natural document flow (the default HTML behavior), which ensures that they are visible on all devices, regardless of JavaScript and CSS positioning support.
- +A "fixed" positioning mode provides the convenience of static toolbars without the drawbacks of implementing faux-scrolling in JavaScript. The toolbars start in their natural positions on the page, like the "inline" mode, but when a bar scrolls out of the viewport, the framework animates the bar back into view by dynamically re-positioning the bar to the top or bottom of the viewport.
At any time, tapping the screen will toggle the visibility of the fixed toolbars: tapping the page when the toolbars aren't visible brings them into view, tapping again hides them until you tap again. This gives users the option to hide the toolbars until needed to maximize screen real estate.
To set this behavior on a header or footer, add the data-position="fixed" attribute to the toolbar container.
A "fullscreen" position mode works just like the fixed mode except that the toolbars aren't shown at the top and bottom of the page and only appear when the page is clicked. This is useful for immersive apps like photo or video viewers where you want the content to full when whole screen and toolbars can be summoned to appear by tapping the screen. Keep in mind that the toolbars in this mode will sit over page content so this is best used for specific situations.
- -The footer bar has the same basic structure as the header except it uses the data-role attribute value of footer.
The footer bar has the same basic structure as the header except it uses the data-role attribute value of footer.
-<div data-role="footer">
- <h4>Footer content</h4>
-</div>
-
+<div data-role="footer">
+ <h4>Footer content</h4>
+</div>
+
The footer toolbar will be be themed with the "a" swatch by default (black in the default theme) but you can easily set the theme swatch color.
The footer toolbar will be be themed with the "a" swatch by default (black in the default theme) but you can easily set the theme swatch color.
The page footer is very similar to the header in terms of options and configuration. The primary differences are that the footer is designed to be less structured than the header to allow for more flexibility, so the framework doesn't automatically place buttons to the left or right based on source order as it does in the header.
+ +The page footer is very similar to the header in terms of options and configuration. The primary differences are that the footer is designed to be less structured than the header to allow for more flexibility, so the framework doesn't automatically place buttons to the left or right based on source order as it does in the header.
Any link or valid button markup added to the footer will automatically be turned into a button. To save space, buttons in toolbars are automatically set to inline styling so the button is only as wide as the text and icons it contains.
- +By default, toolbars don't have any padding to accommodate nav bars and other widgets. To include padding on the bar, add a class="ui-bar" to the footer.
<div data-role="footer" class="ui-bar">
@@ -70,9 +70,9 @@ Adding buttons
Up
Down
To group buttons together into a button set, wrap the links in a wrapper with data-role="controlgroup" and data-type="horizontal" attributes.
<div data-role="controlgroup" data-type="horizontal">
This creates a grouped set of buttons:
@@ -85,13 +85,13 @@Form elements and other content can also be added to toolbars. Here is an example of a select menu inside a footer bar:
- + - - - + + +In situations where the footer is a global navigation element, you may want it to appear fixed in place between page transitions. This can be accomplished by using the persistent footer feature included in jQuery Mobile.
- +In situations where the footer is a global navigation element, you may want it to appear fixed in place between page transitions. This can be accomplished by using the persistent footer feature included in jQuery Mobile.
+To make a footer stay in place between transitions, add the data-id attribute to the footer of all relevant pages and use the same id value for each. For example, by adding data-id="myfooter" to the current page and the target page, the framework will keep the footer anchors in the same spot during the page animation. PLEASE NOTE: This effect will only work correctly if the header and footer toolbars are set to data-position="fixed" so they are in view during the transition.
The header is a toolbar at the top of the page that usually contains the page title text and optional buttons positioned to the the left and/or right of the title for navigation or actions.
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.
+The header is a toolbar at the top of the page that usually contains the page title text and optional buttons positioned to the the left and/or right of the title for navigation or actions.
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.
+ +
-<div data-role="header">
- <h1>Page Title</h1>
-</div>
-
-The header toolbar is themed with the "a" swatch by default (black in the default theme) but you can easily set the theme swatch color.
The header toolbar is themed with the "a" swatch by default (black in the default theme) but you can easily set the theme swatch color.
In the standard header configuration, there are slots for buttons on either side of the text heading. Each button is typically an anchor element, but any valid button markup will work. To save space, buttons in toolbars are set to inline styling so the button is only as wide as the text and icons it contains.
The header 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.
- -
+ The header 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.
+
+
+
<div data-role="header" data-position="inline">
<a href="index.html" data-icon="delete">Cancel</a>
<h1>Edit Contact</h1>
<a href="index.html" data-icon="check">Save</a>
</div>
-
-
+
+
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 data-theme attribute and set the color swatch for the button to "b" to make the "Save" button pop.
-
-
+
+
<div data-role="header" data-position="inline">
<a href="index.html" data-icon="delete">Cancel</a>
<h1>Edit Contact</h1>
<a href="index.html" data-icon="check" data-theme="b">Save</a>
</div>
-
-
+
+
-
+
Controlling button position with classes
-
- 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 ui-btn-left or ui-btn-right to the anchor.
-
+ 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 ui-btn-left or ui-btn-right to the anchor.
-
+
+
+
-<div data-role="header" data-position="inline"
+<div data-role="header" data-position="inline"
<h1>Page Title</h1>
<a href="index.html" data-icon="gear" class="ui-btn-right">Options</a>
</div>
-
-
+
+
Page Title
Options
-
-
+
+
Adding Back buttons
-
- jQuery Mobile has a feature to automatically create and append "back" buttons to any header, though it is disabled by default. This is primarily useful in chromeless installed applications, such as those running in a native app web view. The framework automatically generates a "back" button on a header when the page plugin's addBackBtn option is true. This can also be set via markup if the page div has a data-add-back-btn="true" attribute.
-
-
- If you use the attribute data-rel="back" on an anchor, any clicks on that anchor will mimic the back button, going back one history entry and ignoring the anchor's default href. This is particularly useful when linking back to a named page, such as a link that says "home", or when generating "back" buttons with JavaScript, such as a button to close a dialog. When using this feature in your source markup, be sure to provide a meaningful href that actually points to the URL of the referring page (this will allow the feature to work for users in C-Grade browsers. Also, please keep in mind that if you just want a reverse transition without actually going back in history, you should use the data-direction="reverse" attribute instead.
-
- Customizing the back button text
-
+
+ jQuery Mobile has a feature to automatically create and append "back" buttons to any header, though it is disabled by default. This is primarily useful in chromeless installed applications, such as those running in a native app web view. The framework automatically generates a "back" button on a header when the page plugin's addBackBtn option is true. This can also be set via markup if the page div has a data-add-back-btn="true" attribute.
+
+
+ If you use the attribute data-rel="back" on an anchor, any clicks on that anchor will mimic the back button, going back one history entry and ignoring the anchor's default href. This is particularly useful when linking back to a named page, such as a link that says "home", or when generating "back" buttons with JavaScript, such as a button to close a dialog. When using this feature in your source markup, be sure to provide a meaningful href that actually points to the URL of the referring page (this will allow the feature to work for users in C-Grade browsers. Also, please keep in mind that if you just want a reverse transition without actually going back in history, you should use the data-direction="reverse" attribute instead.
+
+ Customizing the back button text
+
If you'd like to configure the back button text, you can either use the data-back-btn-text="previous" attribute on your page element, or set it programmatically via the page plugin's options: $.mobile.page.prototype.options.backBtnText = "previous";.
-
+
Default back button style
If you'd like to configure the back button role-theme, you can use: $.mobile.page.prototype.options.backBtnTheme = "a";.
If you're doing this programmatically, set this option inside the mobileinit event handler.
Custom header configurations
- If you need to to create a header that doesn't follow the default configuration, simply wrap your custom styled markup in a container div inside the header container and the plugin won't apply the automatic button logic so you can write custom styles for laying out the content in your header.
+ If you need to to create a header that doesn't follow the default configuration, simply wrap your custom styled markup in a container div inside the header container and the plugin won't apply the automatic button logic so you can write custom styles for laying out the content in your header.
-
jQuery Mobile has a very basic navbar widget that is useful for providing up to 5 buttons with optional icons in a bar , typically within a header or footer.
- +A navbar is coded as an unordered list of links wrapped in a container element that has the data-role="navbar" attribute. To set one of links to the active (selected) state, add class="ui-btn-active" to the anchor. In this example, we have a two-button navbar in the footer with the "One" item set to active:
<div data-role="footer">
<div data-role="navbar">
@@ -49,7 +49,7 @@ Simple navbar
Adding a third item will automatically make each button 1/3 the width of the browser window:
Adding a fourth more item will automatically make each button 1/4 the width of the browser window:
If more than 5 items are added, the navbar will simply wrap to multiple lines:
- +As a fallback, navbars with 1 item will simply render as 100%.
- +If you want to add a navbar to the top of the page, you can still have a page title and buttons. Just add the navbar container inside the header block, right after the title and buttons in the source order.
- +Icons can be added to navbar items by adding the data-icon attribute specifying a standard mobile icon to each anchor.
Icons can be stacked above the labels by adding the data-iconpos="top" attribute to each anchor.
You can add any of the popular icon libraries like Glyphish to achieve the iOS style tab tab that has large icons stacked on top of text labels. All that is required is a bit of custom styles to link to the icons and position them in the navbar. Here is an example using Glyphish icons and custom styles (view page source for styles) in our navbar:
- - - - + - +Icons by Joseph Wain / glyphish.com. Licensed under the Creative Commons Attribution 3.0 United States License.
Navbars can be set to any theme color by data-theme attribute to the links and specifying any theme swatch.
This page is a demo of a persistent footer navigation bar. At the foot of the page, you'll see a persistent horizontal navigation bar. Click on any of the links, and you'll see the page content transition but the footer remain fixed: The footer sticks persistently even when transitioning to a new HTML page, because the footer on all four HTML pages has the same data-id attribute. Note: If you'd like an active button in your navbar to remain active when you return to it again, add a class of ui-state-persist in addition to ui-btn-active
You've been invited to a meeting at Filament Group in Boston, MA
Hey Stephen, if you're available at 10am tomorrow, we've got a meeting with the jQuery team.
6:24PM
- +Boston Conference Planning
In preparation for the upcoming conference in Boston, we need to start gathering a list of sponsors and speakers.
9:18AM
- +Toolbars are used for headers, footers and utility bars throughout a mobile sites and applications, so jQuery Mobile provides a standard set of bars and navigation tools to cover most standard scenarios.
- +If you're linking to a map page with jQuery Mobile's Ajax behavior, be sure to load google maps in the first real page's head, since it uses document.write and can not be included in the data-role=page div like normal scripts can. View map

A few examples tweaked to make use of the scrollview component.
Alpha Release
The form elements on this page are wrapped by a special div that has event handlers for touchstart, touchmove and touchstop. The checkboxes below control how the event within these handlers is treated when they fire. Use this page to figure out how the various event treatments impact the form elements on you mobile device, then add to the notes at the bottom of the page.
All scrolling on this page is performed by the native viewport, there are no scrollviews on this page.
@@ -245,7 +245,7 @@This page wraps the _handleDragStart, _handleDragMove, and _handleDragStop events of the scrollview widget so that the checkboxes below can determine how the native event is treated. You can use this page to figure out what events need to be caught and what special treatment is necessary to prevent native scrolling. You can also test the effect of that treatment on form elements within the sample scrollview.
@@ -233,7 +233,7 @@
temp_f['data']; ?>° F, condition['data']; ?> - +
low['data']; ?>° F - high['data']; ?>° F, condition['data']; ?>

A Touch-Optimized Web Framework for Smartphones & Tablets
Beta Release
Welcome. Browse the jQuery Mobile components and learn how to make rich, accessible, touch-friendly websites and apps.
- +
Accessibility
Touch events on this page will log out below, prepending to the top as they arrive.
- + Click me - +Touch events on this page will log out below, prepending to the top as they arrive.
- +Touch events on this page will log out below, prepending to the top as they arrive.
- + - + Show all button - +Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Nullam id dolor id nibh ultricies vehicula ut id elit. Nulla vitae elit libero, a pharetra augue.
Nullam quis risus eget urna mollis ornare vel eu leo. Integer posuere erat a ante venenatis dapibus posuere velit aliquet. Nulla vitae elit libero, a pharetra augue. Maecenas sed diam eget risus varius blandit sit amet non magna.
-