diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 00000000..b7ca95b5
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,5 @@
+# Auto detect text files and perform LF normalization
+* text=auto
+
+# JS files must always use LF for tools to work
+*.js eol=lf
diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml
new file mode 100644
index 00000000..5309c6fa
--- /dev/null
+++ b/.github/workflows/node.js.yml
@@ -0,0 +1,31 @@
+# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
+
+name: Node.js CI
+
+on:
+ push:
+ branches: [ "main" ]
+ pull_request:
+ branches: [ "main" ]
+
+jobs:
+ build:
+
+ runs-on: ubuntu-latest
+
+ strategy:
+ matrix:
+ # Old infra requires Node 10
+ node-version: [10.x, 18.x]
+
+ steps:
+ - name: Install xmllint
+ run: sudo apt-get install -y libxml2-utils
+ - uses: actions/checkout@v3
+ - name: Use Node.js ${{ matrix.node-version }}
+ uses: actions/setup-node@v3
+ with:
+ node-version: ${{ matrix.node-version }}
+ cache: 'npm'
+ - run: npm ci
+ - run: npm test
diff --git a/.gitignore b/.gitignore
index b5a693a5..633f1bde 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,9 +1,3 @@
-dist
-node_modules
-config.json
-.project
-*~
-*.diff
-*.patch
-.DS_Store
-.settings
\ No newline at end of file
+/dist/
+/node_modules/
+config.js*
diff --git a/.mailmap b/.mailmap
new file mode 100644
index 00000000..283d1215
--- /dev/null
+++ b/.mailmap
@@ -0,0 +1 @@
+Anne-Gaelle Colom
diff --git a/.npmrc b/.npmrc
new file mode 100644
index 00000000..cffe8cde
--- /dev/null
+++ b/.npmrc
@@ -0,0 +1 @@
+save-exact=true
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 630bbc3d..d6d55695 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -2,4 +2,4 @@ Welcome! Thanks for your interest in contributing to api.jquerymobile.com. You'r
You may also want to take a look at our [commit & pull request guide](http://contribute.jquery.org/commits-and-pull-requests/) and [style guides](http://contribute.jquery.org/style-guide/) for instructions on how to maintain your fork and submit your code. Before we can merge any pull request, we'll also need you to sign our [contributor license agreement](http://contribute.jquery.org/cla).
-You can find us on [IRC](http://irc.jquery.org), specifically in [#jquerymobile-dev](irc://irc.freenode.net/#jquerymobile-dev) and [#jquery-content](irc://irc.freenode.net/#jquery-content) should you have any questions. If you've never contributed to open source before, we've put together [a short guide with tips, tricks, and ideas on getting started](http://contribute.jquery.org/open-source/).
+You can find us on [IRC](http://irc.jquery.org), specifically in #jqueryui-dev and #jquery-content should you have any questions. If you've never contributed to open source before, we've put together [a short guide with tips, tricks, and ideas on getting started](http://contribute.jquery.org/open-source/).
diff --git a/Gruntfile.js b/Gruntfile.js
new file mode 100644
index 00000000..fa66dfde
--- /dev/null
+++ b/Gruntfile.js
@@ -0,0 +1,46 @@
+module.exports = function( grunt ) {
+
+grunt.loadNpmTasks( "grunt-jquery-content" );
+
+grunt.initConfig({
+ xmllint: {
+ all: [
+ "entries/**",
+ "includes/**",
+ "categories.xml",
+ "entries2html.xsl",
+ "notes.xsl"
+ ]
+ },
+ "build-posts": {
+ page: "pages/**"
+ },
+ "build-xml-entries": {
+ all: "entries/**"
+ },
+ "build-resources": {
+ all: "resources/**"
+ },
+ wordpress: (function() {
+
+ // There's no config for CI, but we don't need one for basic testing
+ var config = {};
+ try {
+ config = require( "./config" );
+ } catch ( error ) {}
+ config.dir = "dist/wordpress";
+ return config;
+ })()
+});
+
+grunt.registerTask( "lint", [ "xmllint" ] );
+
+grunt.registerTask( "build", [
+ "build-posts",
+ "build-resources",
+ "build-xml-entries",
+ "build-xml-categories",
+ "build-xml-full"
+]);
+
+};
diff --git a/LICENSE-MIT.txt b/LICENSE.txt
similarity index 62%
rename from LICENSE-MIT.txt
rename to LICENSE.txt
index 8240d81d..47cd4a24 100644
--- a/LICENSE-MIT.txt
+++ b/LICENSE.txt
@@ -1,8 +1,13 @@
-Copyright (c) 2013 jQuery Foundation, http://jquery.org/
+Copyright jQuery Foundation and other contributors, https://jquery.org/
This software consists of voluntary contributions made by many
individuals. For exact contribution history, see the revision history
-and logs, available at http://github.com/jquery/api.jquerymobile.com
+available at https://github.com/jquery/api.jquerymobile.com
+
+The following license applies to all parts of this software except as
+documented below:
+
+====
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
@@ -22,3 +27,18 @@ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+====
+
+Copyright and related rights for sample code are waived via CC0. Sample
+code is defined as all source code displayed within the prose of the
+documentation and all examples and demos.
+
+CC0: http://creativecommons.org/publicdomain/zero/1.0/
+
+====
+
+All files located in the node_modules directory are externally
+maintained libraries used by this software which have their own
+licenses; we recommend you read them, as their terms may differ from the
+terms above.
diff --git a/README.md b/README.md
index de73f94d..c5288026 100644
--- a/README.md
+++ b/README.md
@@ -1,15 +1,12 @@
-api.jquerymobile.com
-====================
+# api.jquerymobile.com
-## Building
+## Building and Deploying
-### Requirements
-* libxml2
-* libxslt
-
-The `xmllint` and `xsltproc` utilities need to be in your path. If you are on Windows, you can get libxml2 and libxslt from GnuWin32.
+To build and deploy your changes for previewing in a [`jquery-wp-content`](https://github.com/jquery/jquery-wp-content) instance, follow the [workflow instructions](http://contribute.jquery.org/web-sites/#workflow) from our documentation on [contributing to jQuery Foundation web sites](http://contribute.jquery.org/web-sites/).
-### Build
+### Requirements
-To build and deploy your changes for previewing in a [`jquery-wp-content`](https://github.com/jquery/jquery-wp-content) instance, follow the [workflow instructions](http://contribute.jquery.org/web-sites/#workflow) from our documentation on [contributing to jQuery Foundation web sites](http://contribute.jquery.org/web-sites/).
+* [libxml2](http://xmlsoft.org/)
+* [libxslt](http://xmlsoft.org/libxslt/)
+The `xmllint` and `xsltproc` utilities need to be in your path. If you are on Windows, you can get libxml2 and libxslt from GnuWin32.
diff --git a/categories.xml b/categories.xml
index 9ba46297..7b3b3db9 100644
--- a/categories.xml
+++ b/categories.xml
@@ -2,7 +2,22 @@
@@ -12,9 +27,20 @@
+
+
+
-
-
+
+
+
+
+
+ Button WidgetCreates a button widget
-
-
Buttons are coded with standard HTML anchor and input elements, then enhanced by jQuery Mobile to make them more attractive and useable on a mobile device. Use anchor links (a elements) to mark up navigation buttons, and input or button elements for form submission.
-
-
Styling links as buttons
-
In the main content block of a page, you can style any anchor link as a button by adding the data-role="button" attribute. The framework will enhance the link with markup and classes to style the link as a button. For example, this markup:
Note: Links styled like buttons have all the same visual options as true form-based buttons below, but there are a few important differences. Link-based buttons aren't part of the button plugin and only just use the underlying buttonMarkup plugin to generate the button styles so the form button methods (enable, disable, refresh) aren't supported. If you need to disable a link-based button (or any element), it's possible to apply the disabled class ui-disabled yourself with JavaScript to achieve the same effect.
This will produce a button that is not as tall as the standard version and has a smaller text size.
-
-
-
-
Form buttons
-
-
For ease of styling, the framework automatically converts any button or input element with a type of submit, reset, or button into a custom styled button - there is no need to add the data-role="button" attribute. However, if needed, you can directly call the button plugin on any selector, just like any jQuery plugin:
-
-
-$( "[type='submit']" ).button();
-
-
-
Button based button:
-
-
-<button>Button element</button>
-
-
-
-
-
Input type="button" based button:
-
-<input type="button" value="Button" />
-
-
-
-
-
Input type="submit" based button:
-
-<input type="submit" value="Submit Button" />
-
-
-
-
-
Input type="reset" based button:
-
-<input type="reset" value="Reset Button" />
-
-
-
-
-
Adding Icons to Buttons
-
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:
By default, all icons in buttons are placed to the left of the button text.
-
-
-
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:
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":
The mini and inline attributes can be added to produce more compact buttons:
-
-
-
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: ui-icon-myapp-email.
-
You can then write a CSS rule in your stylesheet that targets the ui-icon-myapp-email class to specify the icon background source. To maintain visual consistency with the rest of the icons, create a white icon 18x18 pixels saved as a PNG-8 with alpha transparency.
-
In this example, we're just pointing to a standalone icon image, but you could just as easily use an icon sprite and specify the positioning instead, just like the icon sprite we use in the framework.
This will create the standard resolution icon, but many devices now have very high resolution displays, like the retina display on the iPhone 4. To add a HD icon, create an icon that is 36x36 pixels (exactly double the 18 pixel size), and add second a rule that uses the -webkit-min-device-pixel-ratio: 2 media query to target a rule only to high resolution displays. Specify the background image for the HD icon file and set the background size to 18x18 pixels which will fit the 36 pixel icon into the same 18 pixel space. The media query block can wrap multiple icon rules:
-
-@media only screen and (-webkit-min-device-pixel-ratio: 2) {
- .ui-icon-myapp-email {
- background-image: url( "app-icon-email-highres.png" );
- background-size: 18px 18px;
- }
- ...more HD icon rules go here...
-}
-
-
-
Inline buttons
-
-
By default, all buttons in the body content are styled as block-level elements so they fill the width of the screen:
-
-
-
-
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.
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.
-
-
Icon example
-
-
-
-
Grouped buttons
-
-
Occasionally, you may want to visually group a set of buttons 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.
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.)
-
-
-
-
-
Labels
-
Because the label element will be associated with each individual input or button and will be hidden for styling purposes, we recommend wrapping the buttons in a fieldset element that has a legend which acts as the combined label for the group. Using the label as a wrapper around an input prevents the framework from hiding it, so you have to use the for attribute to associate the label with the input.
-
-
Theming buttons
-
-
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 its 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:
-
-
-
Assigning theme swatches
-
Buttons 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.
Here are 5 buttons with icons that have a different swatch letter assigned via the data-theme attribute.
-
-
-
Theme variations
-
-
-
-
+
+
The jQuery UI button widget is bundled in jQuery Mobile with some changes. Thus, its API documentation fully describes its functionality.
+ 1.0
-
+
-
+
-
+
-
-
-
- triggered when a form button is created
-
-
-
-
-
-
-
-
- enable a disabled form button.
-
-$( "[type='submit']" ).button( "enable" );
-
-
-
-
- disable a form button.
-
-$( "[type='submit']" ).button( "disable" );
-
-
-
-
- update the form button.
-
If you manipulate a form button via JavaScript, you must call the refresh method on it to update the visual styling.
-
-$( "[type='submit']" ).button( "refresh" );
-
-
-
-
-
-
- A basic example of a button
-
-
diff --git a/entries/checkboxradio.xml b/entries/checkboxradio.xml
index 48be0d96..99363bae 100644
--- a/entries/checkboxradio.xml
+++ b/entries/checkboxradio.xml
@@ -1,277 +1,28 @@
-
+Checkboxradio WidgetCreates a checkboxradio widget
-
Checkboxes
-
Checkboxes are used to provide a list of options where more than one can be selected. Traditional desktop checkboxes are not optimized for touch input so in jQuery Mobile, we style the label for the checkboxes so they are larger and look clickable. A custom set of icons are added to the label to provide additional visual feedback.
-
The checkbox controls below use standard input/label markup, but are styled to be more touch-friendly. The styled control you see is actually the label element, which sits over the real input, so if images fail to load, you'll still have a functional control. In most browsers, clicking the label automatically triggers a click on the input, but we've had to trigger the update manually for a few mobile browsers that don't do this natively. On the desktop, these controls are keyboard and screen-reader accessible.
-
To create a single checkbox, add an input with a type="checkbox" attribute and a corresponding label. If the input isn’t wrapped in its corresponding label, be sure to set the for attribute of the label to match the id of the input so they are semantically associated.
This will produce a checkbox that is not as tall as the standard version and has a smaller text size.
-
-
-
Field containers & Legends
-
-
Because checkboxes use the label element for the text displayed next to the checkbox form element, we recommend wrapping the checkbox in a fieldset element that has a legend which acts as the title for the question. Add the data-role="controlgroup" attribute to the fieldset so it can be styled in a parallel way as text inputs, selects or other form elements.
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 fieldset.
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.
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.
-
-
Radio buttons
-
Radio buttons are used to provide a list of options where only a single item can be selected. Traditional desktop radio buttons are not optimized for touch input so jQuery Mobile styles the label for the radio buttons so they are larger and look clickable. A custom set of icons are added to the label to provide additional visual feedback.
-
The radio button controls below use standard input/label markup, but are styled to be more touch-friendly. The styled control you see is actually the label element, which sits over the real input, so if images fail to load, you'll still have a functional control. In most browsers, clicking the label automatically triggers a click on the input, but we've had to trigger the update manually for a few mobile browsers that don't do this natively. On the desktop, these controls are keyboard and screen-reader accessible.
-
-
Vertically grouped radio buttons
-
-
To create a set of radio buttons, add an input with a type="radio" attribute and a corresponding label. Set the for attribute of the label to match the id of the input so they are semantically associated.
-
The label element is displayed next to the radio form element. Wrap the radio buttons in a fieldset element that has a legend which acts as the title for the question.
-
To visually integrate multiple radio buttons into a vertically 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 container.
This will produce a vertically grouped radio button set. The default styles set the width of the button group to 100% of the parent container and stacks the label on a separate line.
-
-
-
Mini version
-
-
For a more compact version that is useful in toolbars and tight spaces, add the data-mini="true" attribute to the element to create a mini version.
Radio buttons can also be used for grouped button sets where only a single button can be selected at once, such as a view switcher control. To make a horizontal radio button set, add the data-type="horizontal" to the fieldset.
The labels float so they sit side-by-side on a line. The radio button icons are hidden and only the left and right edges of the group are rounded.
-
+
The jQuery UI checkboxradio widget is bundled in jQuery Mobile with some changes. Thus, its API documentation fully describes its functionality.
1.0
-
- Sets the size of the element to a more compact, mini version.
-
This option is also exposed as a data attribute: data-mini="true".
+
+
+ Allows you to specify on which side of the checkbox or radio button the checkmark/radio icon will appear.
+
This option is also exposed as a data attribute: data-iconpos="right".
-
+
-
- Sets the color scheme (swatch) for all instances of this widget. It accepts a single letter from a-z that maps to the swatches included in your theme. By default, it will inherit the same swatch color as its parent container if not explicitly set.
-
-
Possible values: swatch letter (a-z).
-
This option is also exposed as a data attribute: data-theme="a".
+
+
+
+ It is difficult to write custom CSS for the wrapper div around the native input element generated by the framework. This option allows you to specify one or more space-separated class names to be added to the wrapper div element by the framework.
+
This option is also exposed as a data attribute: data-wrapper-class="custom-class".
+
-
-
-
- triggered when a checkboxradio is created
-
-
-
-
-
-
-
-
- enable a disabled checkboxradio.
-
-
-
- disable a checkboxradio.
-
-
-
- $( ".selector" ).prop( "checked", true ).checkboxradio( "refresh" );
-
- update the checkboxradio.
-
If you manipulate a checkboxradio via JavaScript, you must call the refresh method on it to update the visual styling.
-
-
-
-
- A basic example of a checkbox in a fieldcontainer
-
-
-
- 300
- A basic example of vertically grouped radio buttons
-
-
diff --git a/entries/classes.xml b/entries/classes.xml
new file mode 100644
index 00000000..22b38e33
--- /dev/null
+++ b/entries/classes.xml
@@ -0,0 +1,212 @@
+
+
+
+ Classes
+ CSS classes for common styles
+
+
Style Classes
+
jQuery Mobile uses the following style classes:
+
+
+
ui-corner-all
+
Adds rounded corners to the element.
+
+
+
ui-shadow
+
Adds an item shadow around the element.
+
+
+
ui-overlay-shadow
+
Adds an overlay shadow around the element. The intended effect is for the element to appear to float above other elements.
+
+
+
ui-mini
+
Reduces the font size and scales down paddings proportionally to produce a miniature version of the element for use in toolbars and tight spaces.
+
+
+
These classes can be applied any of the framework's widgets.
+
Widget-specific classes
+
+
+
ui-collapsible-inset
+
The collapsible widget has horizontal margins, borders, and rounded corners when this class is applied.
+
+
+
ui-listview-inset
+
The listview widget has horizontal margins, borders, and rounded corners when this class is applied.
+
+
+
Button-specific classes
+
In addition to the style classes, you can add the following classes to a (anchor) and button elements to render them touch-friendly:
+
+
Basic options
+
+
ui-btn
+
You must add this class to indicate that the element is to be styled as a button. This is a prerequisite for adding any other button-related classes.
+
+
+
ui-btn-inline
+
Displays the button inline. This means that it will only consume as much space as is needed for the label. This allows you to place buttons side by side, flowing with the text.
+
+
+
ui-shadow-icon
+
Draws a shadow around the icon.
+
+
Icon positioning
+
+
ui-btn-icon-top
+
The icon appears above the text
+
+
+
ui-btn-icon-right
+
The icon appears to the right of the text
+
+
+
ui-btn-icon-bottom
+
The icon appears below the text
+
+
+
ui-btn-icon-left
+
The icon appears to the left of the text
+
+
+
ui-btn-icon-notext
+
The button text is suppressed, and only the icon is shown. The result is a circular button the size of the icon.
+
+
Theme
+
+
ui-btn-[a-z]
+
Sets the color scheme (swatch) for the button. Use a single letter from a-z that maps to the swatches included in your theme. For example: ui-btn-b
+
+
+
Icon classes
+
Icons are used by a variety of widgets. The table below lists all the available icon classes. The widgets which support an icon usually have an option named "icon". The value for that option is the name of the icon, which is appended to the prefix ui-icon- to create the icon class name. In the class list below, the icon names are emphasized as part of the icon class name.
+
+
+
ui-icon-alert
+
An exclamation mark inside a triangle.
+
+
+
ui-icon-arrow-l
+
An arrow pointing left (←).
+
+
+
ui-icon-arrow-r
+
An arrow pointing right (→).
+
+
+
ui-icon-arrow-u
+
An arrow pointing up (↑).
+
+
+
ui-icon-arrow-d
+
An arrow pointing down (↓).
+
+
+
ui-icon-back
+
A curved arrow arcing counterclockwise upwards.
+
+
+
ui-icon-bars
+
Three horizontal bars one above the other.
+
+
+
ui-icon-carat-b
+
A carat pointing down (v).
+
+
+
ui-icon-carat-l
+
A carat pointing left (<).
+
+
+
ui-icon-carat-r
+
A carat pointing right (>).
+
+
+
ui-icon-carat-t
+
A carat pointing up (^).
+
+
+
ui-icon-check
+
A checkmark (✓).
+
+
+
ui-icon-delete
+
A diagonal cross similar to (✕).
+
+
+
ui-icon-edit
+
A pencil - similar to (✎) but pointing to the lower left.
+
+
+
ui-icon-forward
+
A curved arrow arcing clockwise upwards.
+
+
+
ui-icon-gear
+
A gear (⚙).
+
+
+
ui-icon-grid
+
A 3✕3 grid.
+
+
+
ui-icon-home
+
A house similar to (⌂).
+
+
+
ui-icon-minus
+
A "minus" sign (-).
+
+
+
ui-icon-plus
+
A "plus" sign (+).
+
+
+
ui-icon-refresh
+
A circular arrow similar to (⟳).
+
+
+
ui-icon-search
+
A magnifying glass.
+
+
+
ui-icon-star
+
A star similar to (✭).
+
+
+
Theme-related classes
+
The class prefixes in the table below are used for applying a swatch to various parts of the user interface. The actual class name is constructed by appending the swatch letter (a-z) to the prefix. For example, the class ui-body-a is the swatch applied to the page.
+
+
+
ui-bar-[a-z]
+
Sets the color scheme (swatch) for a bar. This includes headers and footers, or bars you include in the page.
+
+
+
ui-body-[a-z]
+
Sets the color scheme (swatch) for a content block. This includes page content panes (deprecated as of 1.4.0), listview items, popups, collapsibles, the loader widget, sliders, and panels.
+
+
+
ui-btn-[a-z]
+
Sets the color scheme (swatch) for a button.
+
+
+
ui-group-theme-[a-z]
+
Sets the color scheme (swatch) for controlgroups, listviews, and collapsible sets (accordions).
+
+
+
ui-overlay-[a-z]
+
Sets the color scheme (swatch) for backgrounds such as those of popup widgets, and page containers.
+
+
+
ui-page-theme-[a-z]
+
Sets the color scheme (swatch) for pages.
+
+
+
ui-panel-page-container-[a-z]
+
Panels temporarily set the theme on the page container using this class.
+
+
+
+
+
diff --git a/entries/collapsible-set.xml b/entries/collapsible-set.xml
deleted file mode 100644
index 44eebc86..00000000
--- a/entries/collapsible-set.xml
+++ /dev/null
@@ -1,170 +0,0 @@
-
-
-
- Collapsible set Widget
- Creates a collapsible set of collapsible blocks of content
-
-
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 1</h3>
- <p>I'm the collapsible set content for section 1.</p>
- </div>
-
- <div data-role="collapsible">
- <h3>Section 2</h3>
- <p>I'm the collapsible set content for section 2.</p>
- </div>
-
-</div>
-
-
-
-
Here is an example of a collapsible set with 5 sections.
-
-
-
Non-inset collapsible sets
-
-
For full width collapsibles without corner styling add the data-inset="false" attribute to the set.
-
-
-
Mini collapsible sets
-
-
For a more compact version that is useful in tight spaces, add the data-mini="true" attribute to the set to create a mini version.
-
-
-
Custom icons
-
-
Collapsible headings’ default icons can be overridden by using the data-collapsed-icon and data-expanded-icon attributes, either at the collapsible-set level or on an individual collapsible basis.
-
-
-
Icon positioning
-
-
Collapsible headings’ default icon positioning can be overridden by using the data-iconpos attribute, either at the collapsible-set level or on an individual collapsible basis.
-
-
-
Theming collapsible content
-
-
The standard data-theme attribute can be used to set the color of each collapsible in a set. To provide a clearer visual grouping of the content with the headers, add the data-content-theme attribute with a swatch letter. This adds a themed background color and border to the content block. For consistent theming, add these attributes to the parent collapsible set.
-
-
To have individual sections in a group styled differently, add data-theme and data-content-theme attributes to specific collapsibles.
-
-
-
Expanding or collapsing items in a set
-
-
To expand or collapse items in a set, call the respective methods on individual collapsibles. The selector for the collapse method can include multiple items in a set:
- Sets the icon for the headers of the collapsible containers when in a collapsed state.
-
This option is also exposed as a data attribute: data-collapsed-icon="arrow-r".
-
-
-
-
- Applies the theme border-radius to the first and last collapsible if set to true.
-
This option is also exposed as a data attribute:data-corners="false".
-
-
-
-
- Sets the icon for the header of the collapsible container when in an expanded state.
-
This option is also exposed as a data attribute: data-expanded-icon="arrow-d".
-
-
-
-
- Positions the icon in the collapsible headers.
-
Possible values: left, right, top, bottom, none, notext.
-
This option is also exposed as a data attribute: data-iconpos="right".
-
-
-
-
- This is used to define the selectors (element types, data roles, etc.) that will automatically be initialized as collapsibles. To change which elements are initialized, bind this option to the mobileinit event:
-
- By setting this option to false the collapsibles will get a full width appearance without corners. If the value is false for an individual collapsible container, but that container is part of a collapsible set, then the value is inherited from the parent collapsible set.
-
This option is also exposed as a data attribute: data-mini="true".
-
-
-
-
- Sets the size of the element to a more compact, mini version. If the value is false for an individual collapsible container, but that container is part of a collapsible set, then the value is inherited from the parent collapsible set.
-
This option is also exposed as a data attribute: data-inset="false".
-
-
-
-
- Sets the color scheme (swatch) for the collapsible set. It accepts a single letter from a-z that maps to the swatches included in your theme.
-
Possible values: swatch letter (a-z).
-
This option is also exposed as a data attribute: data-theme="a".
-
-
-
-
-
-
- Triggered when a collapsible set is created
-
-
-
-
-
-
-
-
- Updates the collapsible set.
-
If you manipulate a collapsible set via JavaScript (e.g. add new collapsible containers), you must call the refresh method on it to update the visual styling.
-
-
-
-
- A basic example of a collapsible set.
-
-
-
-
diff --git a/entries/collapsible.xml b/entries/collapsible.xml
index b5fc7846..2ce0a80e 100644
--- a/entries/collapsible.xml
+++ b/entries/collapsible.xml
@@ -1,192 +1,258 @@
-
+Collapsible WidgetCreates a collapsible block of content
-
To create a collapsible block of content, create a container and add the data-role="collapsible" attribute. Using data-content-theme attribute allows you to set a theme for the content of the collapsible.
+
Collapsible content
+ Note: Collapsible is deprecated as of version 1.5 and will be removed in version 1.6. Use accordion in place of collapsible.
+
To create a collapsible block of content, create a container and add the data-role="collapsible" attribute. Using the data-content-theme attribute allows you to set a theme for the content of the collapsible.
Directly inside this container, add any header (H1-H6) or legend element. 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.
By default, the content will be collapsed.
-
-<div data-role="collapsible">
- <h3>I'm a header</h3>
- <p>I'm the collapsible content. By default I'm closed, but you can click the header to open me.</p>
-</div>
-
+
This code will create a collapsible widget like this:
-
+
-
-
Expanding collapsibles on load
-
To expand the content when the page loads, add the data-collapsed="false" attribute to the wrapper.
+
+
+
+
+ ui-collapsible: The outermost container for collapsible. Contains additional classes of ui-collapsible-inset, ui-collapsible-themed-content and ui-collapsible-collapsed by default unless options to set them false are added.
+
+
+ ui-collapsible-heading: Always visible part of collapsible, which is clicked to open it. Additionally contains ui-collapsible-heading-collapsed class when the collapsible is closed.
+
+
+ ui-collapsible-heading-toggle: Toggler for collapsible
+
+
+ ui-collapsible-heading-status: Status text of the toggler
+
+
+
+
+
+
+ ui-collapsible-content: Content of the collapsible. Additionally contains ui-collapsible-content-collapsed class in case the content is collapsed.
+
For a more compact version that is useful in toolbars and tight spaces, add the data-mini="true" attribute to the element to create a mini version.
+
For a more compact version that is useful in toolbars and tight spaces, add the data-mini="true" attribute to the element to create a mini version.
+
+
-
-<div data-role="collapsible" data-mini="true">
-
-
This code will create a mini collapsible widget:
-
+
Custom icons
-
Collapsible headings’ default icons can be overridden by using the data-collapsed-icon and data-expanded-icon attributes. In the below case, data-collapsed-icon="arrow-r" and data-expanded-icon="arrow-d".
-
-
+
The default icon of collapsible headings can be overridden by using the data-collapsed-icon and data-expanded-icon attributes. The example below uses data-collapsed-icon="arrow-r" and data-expanded-icon="arrow-d".
+
+
Icon positioning
-
Collapsible headings’ default icon positioning can be overridden by using the data-iconpos attribute. In the below case, data-iconpos="right".
-
-
+
The default icon positioning of collapsible headings can be overridden by using the data-iconpos attribute. The example below uses data-iconpos="right".
+
+
Theming collapsible content
-
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.
-
-
To provide a stronger visual connection between the collapsible header and content, add the data-content-theme attribute to the wrapper and specify a theme swatch letter. This will apply the swatch's border and flat background color (not the gradient) to the content block and changes the corner rounding to square off the bottom of the header and round the bottom of the content block instead to visually group these elements.
-
-
-<div data-role="collapsible" data-content-theme="c">
- <h3>Header</h3>
- <p>I'm the collapsible content with a themed content block set to "c".</p>
-</div>
-
+
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 within which it sits.
-
+
To provide a stronger visual connection between the collapsible header and content, add the data-content-theme attribute to the wrapper and specify a theme swatch letter. This applies the border and background color of the swatch to the content block and changes the corner rounding to square off the bottom of the header and round the bottom of the content block instead to visually group these elements.
+
+
+
+
Theming collapsible headers
To set the theme on a collapsible header button, add the data-theme attribute to the wrapper and specify a swatch letter. Note that you can mix and match swatch letters between the header and content with these theme attributes.
-
<div data-role="collapsible" data-theme="a" data-content-theme="a">
- <h3>Header swatch A</h3>
- <p>I'm the collapsible content with a themed content block set to "a".</p>
-</div>
-
+
-
+
Nested Collapsibles
Collapsibles can be nested inside each other if needed. In this example, we're setting the content theme to provide clearer visual connection between the levels.
-
-
+
+
Collapsible sets (accordions)
-
It's possible to combine multiple collapsibles into a grouped set that acts like an accordion widget.
+
It's possible to combine multiple collapsibles into a grouped set that acts like an accordion widget.
+
+
+
The widget creates an anchor from the heading element and wraps the rest of the children of the outermost widget in a div that will serve as the container for the collapsible content.
+
In the example below, pre-rendered markup for a is provided. The attribute data-collapsed-icon="arrow-r" is explicitly specified, since the use of theui-icon-arrow-r class on the anchor element indicates that the value of the "collapsedIcon" widget option is to be "arrow-r".
+
+
+
+
1.0
+
+ {}
+
+
+
+
- This text is used to provide audible feedback for users with screen reader software.
+ This text is used to provide audible feedback for users with screen reader software.
+
If the value is unset for an individual collapsible container, but that container is part of a collapsible set, then the value is inherited from the parent collapsible set.
+
This option is also exposed as a data attribute: data-collapse-cue-text=" collapse with a click".
- When false, the container is initially expanded with a minus icon in the header.
-
This option is also exposed as a data attribute:data-collapsed="false".
+ When false, the container is initially expanded with a minus icon in the header.
+
This option is also exposed as a data attribute: data-collapsed="false".
- Sets the icon for the header of the collapsible container when in a collapsed state.
-
This option is also exposed as a data attribute:data-collapsed-icon="arrow-r".
+ Sets the icon for the header of the collapsible container when in a collapsed state.
+
If the value is unset for an individual collapsible container, but that container is part of a collapsible set, then the value is inherited from the parent collapsible set.
+
This option is also exposed as a data attribute: data-collapsed-icon="arrow-r".
+
+
+ The name of the icon you wish to use.
+
+
+ In addition to an icon name, you can also set this option to false. In that case, the collapsible will not have an icon in either the expanded or collapsed state. Add data-collapsed-icon="false" to the widget to set the option to false via the data attribute.
+
+
+
+
+ Sets the color scheme (swatch) for the collapsible content. It accepts a single letter from a-z that maps to the swatches included in your theme.
+
If the value is unset for an individual collapsible container, but that container is part of a collapsible set, then the value is inherited from the parent collapsible set.
+
Possible values: swatch letter (a-z).
+
This option is also exposed as a data attribute: data-content-theme="b".
- Applies the theme border-radius if set to true.
-
This option is also exposed as a data attribute:data-corners="false".
+ Applies the theme border-radius if set to true.
+
If the value is unset for an individual collapsible container, but that container is part of a collapsible set, then the value is inherited from the parent collapsible set.
+
This option is also exposed as a data attribute: data-corners="false".
+
+
+
- This text is used to provide audible feedback for users with screen reader software.
+ This text is used to provide audible feedback for users with screen reader software.
+
If the value is unset for an individual collapsible container, but that container is part of a collapsible set, then the value is inherited from the parent collapsible set.
+
This option is also exposed as a data attribute: data-expand-cue-text=" expand with a click".
- Sets the icon for the header of the collapsible container when in an expanded state.
+ Sets the icon for the header of the collapsible container when in an expanded state.
+
If the value is unset for an individual collapsible container, but that container is part of a collapsible set, then the value is inherited from the parent collapsible set.
This option is also exposed as a data attribute: data-expanded-icon="arrow-d".
Within the collapsible container, the first immediate child element that matches this selector will be used as the header for the collapsible.
+
This option is also exposed as a data attribute: data-heading=".mycollapsibleheading".
- Positions the icon in the collapsible header.
+ Positions the icon in the collapsible header.
+
If the value is unset for an individual collapsible container, but that container is part of a collapsible set, then the value is inherited from the parent collapsible set.
Possible values: left, right, top, bottom, none, notext.
This option is also exposed as a data attribute: data-iconpos="right".
-
- This is used to define the selectors (element types, data roles, etc.) that will automatically be initialized as collapsibles. To change which elements are initialized, bind this option to the mobileinit event:
-
- By setting this option to false the element will get a full width appearance without corners. If the value is false for an individual collapsible container, but that container is part of a collapsible set, then the value is inherited from the parent collapsible set.
+
+
+ By setting this option to false the element will get a full width appearance without corners.
+
If the value is unset for an individual collapsible container, but that container is part of a collapsible set, then the value is inherited from the parent collapsible set.
This option is also exposed as a data attribute: data-inset="false".
-
- Sets the size of the element to a more compact, mini version. If the value is false for an individual collapsible container, but that container is part of a collapsible set, then the value is inherited from the parent collapsible set.
+
+ Sets the size of the element to a more compact, mini version.
+
If the value is unset for an individual collapsible container, but that container is part of a collapsible set, then the value is inherited from the parent collapsible set.
This option is also exposed as a data attribute: data-mini="true".
-
- Sets the color scheme (swatch) for the collapsible. It accepts a single letter from a-z that maps to the swatches included in your theme.
+
+ Sets the color scheme (swatch) for the collapsible. It accepts a single letter from a-z that maps to the swatches included in your theme.
+
If the value is unset for an individual collapsible container, but that container is part of a collapsible set, then the value is inherited from the parent collapsible set.
Possible values: swatch letter (a-z).
-
This option is also exposed as a data attribute: data-theme="a".
+
This option is also exposed as a data attribute: data-theme="b".
-
- Triggered when a collapsible is created
-
-
-
-
-
-
-
-
+ Triggered when a collapsible is collapsed
@@ -209,6 +275,20 @@ $( document ).on( "mobileinit", function() {
+
+
+ Collapses the .
+
+
+
+
+
+
+
+ Expands the .
+
+
+ A basic example of a collapsible content block.
@@ -217,7 +297,7 @@ $( document ).on( "mobileinit", function() {
jQuery Mobile Example
-
+
I'm a header
I'm the collapsible content. By default I'm closed, but you can click the header to open me.
diff --git a/entries/collapsibleset.xml b/entries/collapsibleset.xml
new file mode 100644
index 00000000..5e319276
--- /dev/null
+++ b/entries/collapsibleset.xml
@@ -0,0 +1,194 @@
+
+
+
+ Collapsibleset Widget
+ Creates a set of collapsible blocks of content
+
+
Sets of collapsibles
+
jQuery Mobile will visually style a set of collapsibles as a group and will make the set behave like an accordion in that only one collapsible can be open at a time if you wrap the collapsibles in a div that has the attribute data-role="collapsibleset".
+
+
By default, all the collapsible 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.
+
+
+
+
Here is an example of a widget with 5 sections.
+
+
+
Non-inset widgets
+
+
For full width collapsibles without corner styling add the data-inset="false" attribute to the set.
+
+
+
Mini widgets
+
+
For a more compact version that is useful in tight spaces, add the data-mini="true" attribute to the set to create a mini version.
+
+
+
Custom icons
+
+
The icon displayed when a collapsible is shown or hidden can be overridden by using the data-collapsed-icon and data-expanded-icon attributes. Both the collapsibleset widget and the collapsible widget accepts these attributes. When you set one or both of these attributes on the collapsibleset widget all collapsible widgets that are part of the collapsibleset display the icon specified by the chosen value. You can override the icon displayed by individual collapsible widgets by setting one or both of these attributes on the collapsible widget itself.
+
+
+
Icon positioning
+
+
The default icon positioning for collapsible headings can be overridden by using the data-iconpos attribute. You can set the attribute either on the collapsibleset to affect all collapsibles in the set, or on an individual collapsible widget to affect only the one widget.
+
+
+
Theming collapsible content
+
+
The standard data-theme attribute can be used to set the color of each collapsible in a set. To provide a clearer visual grouping of the content with the headers, add the data-content-theme attribute with a swatch letter. This adds a themed background color and border to the content block. For consistent theming, add these attributes to the parent widget.
+
+
+
+
+
+
Theming individual sections
+
+
To have individual sections in a group styled differently, add data-theme and data-content-theme attributes to specific collapsibles.
+
+
+
+
The widget does not require that the collapsibles it contains also be pre-rendered.
+
In the example below, pre-rendered markup for a is provided. The attribute data-corners="false" is explicitly specified, since the absence of the ui-corner-all class on the container element indicates that the "corners" widget option is to be false. One of the child collapsibles is provided as-is, while the other is pre-rendered.
+
+
+
+
+
+
+ 1.0
+
+
+ Sets the icon for the headers of the collapsible containers when in a collapsed state.
+
This option is also exposed as a data attribute: data-collapsed-icon="arrow-r".
+
+
+
+
+ Applies the theme border-radius to the first and last collapsible if set to true.
+
This option is also exposed as a data attribute:data-corners="false".
+
+
+
+
+
+
+
+ Sets the icon for the header of the collapsible container when in an expanded state.
+
This option is also exposed as a data attribute: data-expanded-icon="arrow-d".
+
+
+
+
+ Positions the icon in the collapsible headers.
+
Possible values: left, right, top, bottom, none, notext.
+
This option is also exposed as a data attribute: data-iconpos="right".
+
+
+
+
+
+
The default initSelector for the widget is:
+
+ ""
+
+
This option is deprecated in 1.4.0 and will be removed in 1.5.0.
+
The old value of the widget's initSelector option (":jqmData(role='collapsible-set')") is deprecated. As of jQuery Mobile 1.5.0, only widgets that have the attribute data-role="collapsibleset" will be enhanced as widgets.
+
As of jQuery Mobile 1.4.0, the initSelector is no longer a widget option. Instead, it is declared directly on the widget prototype. Thus, you may specify a custom value by handling the mobileinit event and overwriting the initSelector on the prototype:
Note: Remember to attach the mobileinit handler after you have loaded jQuery, but before you load jQuery Mobile, because the event is triggered as part of jQuery Mobile's loading process.
+
The value of this option is a jQuery selector string. The framework selects elements based on the value of this option and instantiates widgets on each of the resulting list of elements.
+
+
+
+
+ By setting this option to false the collapsibles will get a full width appearance without corners. If the value is false for an individual collapsible container, but that container is part of a widget, then the value is inherited from the parent widget.
+
This option is also exposed as a data attribute: data-inset="true".
+
+
+
+
+ Sets the size of the element to a more compact, mini version. If the value is false for an individual collapsible container, but that container is part of a widget, then the value is inherited from the parent widget.
+
This option is also exposed as a data attribute: data-mini="false".
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Updates the widget.
+
If you manipulate a widget via JavaScript (e.g. by adding new collapsibles, removing old ones, or showing/hiding existing ones), you must call the refresh method on it to update the visual styling. This method will instantiate collapsibles on child elements which are marked data-role="collapsible", so there is no need to manually call .collapsible().
+
+
+
+
+
+ A basic example of a widget.
+
+
+
+
diff --git a/entries/controlgroup.xml b/entries/controlgroup.xml
index 96c38edd..84357af9 100644
--- a/entries/controlgroup.xml
+++ b/entries/controlgroup.xml
@@ -1,58 +1,18 @@
-
+Controlgroup WidgetGroups buttons together.
-
-
Occasionally, you may want to visually group a set of buttons 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.
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:
-
-
-
Labels
-
If you use a controlgroup for input, button or select buttons we recommend wrapping them in a fieldset element that has a legend which acts as the combined label for the group. The label elements of each individual button in the group will be hidden for styling purposes, and are only accessible by screen readers. Using the label as a wrapper around the form element prevents the framework from hiding it, so you have to use the for attribute to associate the label with the input.
-
+
+
The jQuery UI controlgroup widget is bundled in jQuery Mobile with some changes. Thus, its API documentation fully describes its functionality.
1.3
-
-
-
Sets whether to draw the controlgroup with rounded corners.
-
This option is also exposed as a data attribute: data-corners="false".
-
-
-
-
-
-
Sets whether to exclude invisible children in the assignment of rounded corners.
-
When set to false, all children of a controlgroup are taken into account when assigning rounded corners, including hidden children. Thus, if, for example, the controlgroup's first child is hidden, the controlgroup will, in effect, not have rounded corners on the top edge.
-
This option is also exposed as a data attribute: data-exclude-invisible="false".
-
-
-
-
-
-
If set to true, this will display a more compact version of the controlgroup that uses less vertical space. Possible values: true, false.
-
This option is also exposed as a data attribute: data-mini="true".
-
-
-
Sets whether a drop shadow is drawn around the controlgroup.
+
This option is also exposed as a data attribute: data-shadow="false".
@@ -60,52 +20,29 @@
Sets whether children should be stacked on top of each other or next to each other. If set to "horizontal", the children of the controlgroup will be stacked next to each other.
+
This option is also exposed as a data attribute: data-type="horizontal".
-
+
-
This is used to define the selectors (element types, data roles, etc.) that will automatically be initialized as controlgroups. To change which elements are initialized, bind this option to the mobileinit event:
By default, controlgroup displays its controls in a vertical layout. Use this option to use a horizontal layout instead.
+
This option is also exposed as a data-attribute data-direction="horizontal".
-
+
+
-
-
- Triggered when a controlgroup is created.
-
-
-
-
-
- Obtain the container element within which the controlgroup's child elements are to be placed.
-
+
+
-
- A basic example of a controlgroup.
-
-
diff --git a/entries/dialog.xml b/entries/dialog.xml
index 7e5462e0..06e8b7e6 100644
--- a/entries/dialog.xml
+++ b/entries/dialog.xml
@@ -1,43 +1,45 @@
-
+Dialog WidgetOpens content in an interactive overlay.
+
+ Note: Dialogs are deprecated as of jQuery Mobile 1.4.0 and will be removed in 1.5.0. The dialog option provided by the page.dialog extension of the page widget allows you to style a page as a dialog, however, the special navigational handling will be removed. You may also consider implementing dialogs using popup widgets.
Any page can be presented as a modal dialog by adding the data-rel="dialog" attribute to the page anchor link. When the "dialog" attribute is applied, the framework adds styles to add rounded corners, margins around the page and a dark background to make the "dialog" appear to be suspended above the page.
You can open a dialog programmatically by calling the $.mobile.changePage method:
-
-// Dialog loaded via AJAX
+
Transitions
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", "slidedown" or "flip". Possible values include: fade, pop, flip, turn, flow, slidefade, slide, slideup, slidedown, none.
When any link is clicked within a dialog, the framework will automatically close the dialog and transition to the requested page, just as if the dialog were a normal page. Nevertheless, dialogs can also be chained, as explained below under "Chaining Dialogs". Similarly, a link that opens a popup will also leave the dialog in place.
-
+
If the dialog has a header the framework will add a close button at the left side of the header. You can change the position by adding data-close-btn="right" to the dialog container. If you don't want a close button in the header or add a custom close button, you can use data-close-btn="none".
-
+
-
+
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" ).
Dialogs can be styled with different theme swatches, just like any page by adding data-theme attributes to the header, content, or footer containers.
-
+
By default dialogs have rounded corners. The option corners can be set to false by adding data-corners="false" to the dialog container:
-
+
Dialogs appear to be floating above an overlay layer. This overlay adopts the swatch 'a' content color by default, but the data-overlay-theme attribute can be added to the page wrapper to set the overlay to any swatch letter.
For the sake of readability, dialogs have a default width of 92.5% and a max-width of 500 pixels. There is also a 10% top margin to give dialogs larger top margin on larger screens, but collapse to a small margin on smartphones. The dialog's inner container is shifted towards the top with 15px to hide the corner styling if a dialog is used as a control sheet (see above). To override these styles, add the following CSS override rule to your stylesheet and tweak as needed:
Customizes the text of the close button which is helpful for translating this into different languages. This is displayed as an icon-only button by default so the text isn't visible on-screen, but is read by screen readers so this is an important accessibility feature.
-
This option is also exposed as a data attribute: data-close-btn-text.
+
Customizes the text of the close button which is helpful for translating this into different languages. The close button is displayed as an icon-only button by default so the text isn't visible on-screen, but is read by screen readers so this is an important accessibility feature.
+
This option is also exposed as a data attribute: data-close-btn-text="Fermer".
- Sets whether to draw the dialo with rounded corners..
+ Sets whether to draw the dialo with rounded corners..
This option is also exposed as a data attribute:data-corners="false".
-
-
- This is used to define the selectors (element types, data roles, etc.) that will automatically be initialized as dialogs. To change which elements are initialized, bind this option to the mobileinit event:
-
Dialogs appear to be floating above an overlay layer. This overlay adopts the swatch A content color by default, but the data-overlay-theme attribute can be added to the page wrapper to set the overlay to any swatch letter.
Possible values: swatch letter (a-z)
-
This option is also exposed as a data attribute: data-overlay-theme="e".
+
This option is also exposed as a data attribute: data-overlay-theme="b".
diff --git a/entries/enhanceWithin.xml b/entries/enhanceWithin.xml
new file mode 100644
index 00000000..904d800f
--- /dev/null
+++ b/entries/enhanceWithin.xml
@@ -0,0 +1,53 @@
+
+
+ .enhanceWithin()
+ Enhance all the children of all elements in the set of matched elements.
+
+
This method is responsible for performing all jQuery Mobile enhancement. Given a set of DOM elements it will enhance their children with all the widgets available.
+
The enhancement is based on each widget's initSelector property. This selector will be used to identify the elements upon which the widget will be instantiated.
+
You can shield elements and their children from enhancement by adding the attribute data-enhance="false" to an element. This will cause it, and all its children to be ignored by .enhanceWithin(). Unfortunately, checking elements to see whether they are children of an element that has been marked with data-enhance="false" is performance-intensive. Thus, the presence of data-enhance="false" will only be considered if the global flag $.mobile.ignoreContentEnabled is set to true.
+
Caveat: does not attempt to resolve issues related to the order in which widgets are enhanced. For example, enhancing filterable widgets before checkboxradio widgets are enhanced can cause the checkboxradio widgets to be displayed incorrectly. If this affects you, then you must ensure that the widgets which need to be enhanced early are instantiated before the rest of the widgets. One possibility for accomplishing this is to instantiate your widgets during the page widget's pagebeforecreate event.
+
+
+
+
+ 550
+ Injecting new content at runtime and enhancing it with .
+
+
+
+
diff --git a/entries/filterable.xml b/entries/filterable.xml
new file mode 100644
index 00000000..77534414
--- /dev/null
+++ b/entries/filterable.xml
@@ -0,0 +1,252 @@
+
+
+
+ Filterable Widget
+ Makes the children of an element filterable.
+
+
Filterable Widget
+
The widget allows you to filter the children of an element. The filtering is accomplished by applying the class ui-screen-hidden to those children for which a filter callback function provided via the widget's filterCallback option returns true.
+
Backwards compatibility
+ The widget features provided for backwards compatibility are deprecated as of 1.4.0 and will be removed in 1.5.0.
+
The filterable widget is a generalization of the listview widget's filter extension that was available in jQuery Mobile 1.3. It retains API compatibility with the listview filter. Its behavior is also made backwards compatible by the following deprecated features:
+
+
If no source is provided for the via a data-input attribute, it will generate a text input and place it before the element.
+
It provides the filterPlaceholder option which sets the placeholder attribute on the generated text input.
+
It provides the filterTheme option which sets the theme option on the generated text input.
+
If a collapsibleset, selectmenu, controlgroup, or listview widget is instantiated on the element whose children are to be filtered, it synchronizes those widget options with the generated text input that the text input widget also provides (options such as "corners" or "mini").
+
It provides special handling for listviews:
+
+
When filtering listview items, the default filter callback will not hide list items marked as dividers, however,
+
When filtering listview items, the widget enables the listview widget's hidedividers option, which causes the new listview hidedividers extension to automatically hide dividers for categories wherein all items are hidden.
+
+ Together, these two behaviors reproduce the jQuery Mobile 1.3 behavior of the listview filter.
+
+
+
+
Setup
+
To render the children of an element filterable, perform the following steps:
+
+
Create an element that will serve as the source for the . It can be any element that emits a change signal and has a value that can be accessed via the jQuery .val() plugin. This is usually a text input. The widget reacts to the change signal by reading the value of the input after a short delay and iterating over all the children to determine whether they should be shown or hidden according to the filter callback provided.
+
Add the attribute data-filter="true" to the element whose children will be filtered.
+
Add the attribute data-input to the element whose children will be filtered. The value of the attribute is a string containing a jQuery selector that will return the element to be used as the source for the .
+
Add the child elements that will be filtered. You may add or remove child elements at any time, however, when you add or remove child elements you should call the refresh method on the widget, to ensure that the new children are shown or hidden in accordance with the latest input provided by the user.
+
+ Child elements may have the data-filtertext attribute set. In that case, the default filter callback will hide a given child element only if the value of the data-filtertext attribute does not contain the string provided by the user. If the data-filtertext attribute is absent, the child will be hidden if its text content does not contain the string provided by the user.
+
+
+ The example below illustrates a simple widget setup.
+
+
+
+
"Reveal" mode
+
The normal initial state of a widget is that all the children are shown. In contrast, a in "reveal" mode initially hides all its children. Once the user starts filtering, however, the widget will display only those children that contain the text entered by the user, whether the widget is in "reveal" mode or not.
+
You can turn on "reveal" mode by adding the attribute data-filter-reveal="true" to the element whose children will be filtered.
+
The example below illustrates the behavior of a widget in "reveal" mode:
+
+
+
Custom filters
+
The widget's filterCallback option allows you to set a custom callback. In the example below items are filtered by their ordinal, which can be specified using page printing conventions such as "1,2" or "4-9", or both ("1,2,4-9,12").
The widget runs the filter on its children upon instantiation to ensure that the initial list of displayed children satisfies the initial value of the input source. By setting the attribute data-enhanced="true", you instruct the widget that no initial filtering is to be performed. This means that you must apply the class ui-screen-hidden to any children which must initially be hidden due to the initial value of the search input.
+
Note: If the element whose children are to be filtered is enhanced by another widget as well, such as for example a listview or a controlgroup then you are required to provide pre-rendered markup for the other widget as well, because the attribute data-enhanced="true" will influence the initialization behavior of the other widget as well.
+
In the example below, pre-rendered markup for a is provided. The attribute data-filter-reveal="true" is explicitly specified, since the presence of the ui-screen-hidden class on all the children indicates that they are initially hidden. The controlgroup widget containing the children is also pre-rendered, because the data-enhanced="true" attribute applies to the controlgroup widget as much as it does to the widget.
+
+
+
+
+ 1.4
+
+
+ Provides the list of children which will be processed during filtering. If no children result from examination of the value of this option, then the children of the element from which this widget is constructed will be used.
+
This option is also exposed as a data attribute: data-children=".my-children".
+
+
+ A jQuery selector that will be used to select from the children of the element.
+
+
+ A jQuery object containing the list of elements to filter.
+
+
+ A function that returns a jQuery object containing the list of elements to filter. It will be called with no arguments whenever filtering needs to be performed.
+
+
+ A DOM element. This is a trivial application of the filter.
+
+
+
+ {}
+
+
+
+
+
+
+
+
+ A function that will be called to determine whether an element in the list of children is considered to be filtered. It must return true if the element is to be filtered, and it must return false if the element is to be shown. The function is called once for each of the DOM elements and its context is set to the DOM element for which a decision is needed. Thus, the keyword this refers to the DOM element for which it must be decided whether it should be shown.
+
The default value of this attribute is a function that will examine each child for the presence of the data-filtertext attribute. If such an attribute is found, the function returns true if the string contained in the function's searchValue parameter cannot be found inside the value of the data-filtertext attribute. If no such attribute is found, the text content of the child is searched for the presence of the value of the function's searchValue parameter, and the function returns true if the search fails.
+
For backwards compatibility with the jQuery Mobile 1.3 listview filter extension, the function provided as the default value of this attribute will never hide listview dividers, however, this behavior is deprecated as of jQuery Mobile 1.4.0 and will be removed in jQuery Mobile 1.5.0.
+
You can provide a custom callback if you need to process the children in special ways.
+
+
+
+
+
+
+
+
+ This option is deprecated in 1.4.0 and will be removed in 1.5.0.
+
A string that will be used as the value of the placeholder attribute for the generated text input.
+
This option is also exposed as a data attribute: data-filter-placeholder="Refine options...".
+
+
+
+
+ When set to true all children are hidden whenever the search string is empty.
+
This option is also exposed as a data attribute: data-filter-reveal="true".
+
+
+
+
+
+ This option is deprecated in 1.4.0 and will be removed in 1.5.0.
+
Sets the color scheme (swatch) for the generated text input. It accepts a single letter from a-z that maps to the swatches included in your theme.
+
Possible values: swatch letter (a-z).
+
If a collapsibleset, selectmenu, controlgroup, or listview widget is instantiated on the element and its options are being synchronized with the options of the generated text input, then the value of this option, if set, takes precedence overe the value of the theme option retrieved from the the widget.
+
This option is also exposed as a data attribute: data-filter-theme="b".
+
+
+
+
+ Provides the element that will serve as the input source for search strings.
+
This option is also exposed as a data attribute: data-input="#input-for-filterable".
+
+
+ A jQuery selector that will be used to retrieve the element that will serve as the input source.
+
+
+ A jQuery object containing the element that will serve as the input source.
+
+
+ The element that will serve as the input source.
+
+
+
+
+
+ Triggered before the widget begins filtering the list of children.
+
+
+
+
+ Triggered after the widget has performed the filtering on the list of children. The ui parameter contains the list of children that was processed.
+
+
+
+ A jQuery collection object containing the items over which the filter has iterated.
+
+
+
+
+
+
+
+
+
+
+ Updates the widget.
+
If you manipulate a widget via JavaScript (e.g. by adding new children or removing old ones), you must call the refresh() method on it to update the visual styling.
In browsers that support CSS position: fixed (most desktop browsers, iOS5+, Android 2.2+, BlackBerry 6, and others), toolbars that use the "fixedtoolbar" plugin will be fixed to the top or bottom of the viewport, while the page content scrolls freely in between. In browsers that don't support fixed positioning, the toolbars will remain positioned in flow, at the top or bottom of the page.
-
-
To enable this behavior on a header or footer, add the data-position="fixed" attribute to a jQuery Mobile header or footer element.
Fullscreen fixed toolbars sit on top of the content at all times when they are visible, and unlike regular fixed toolbars, fullscreen toolbars do not fall back to static positioning when toggled. Instead they disappear from the screen entirely. Fullscreen toolbars are ideal for more immersive interfaces, like a photo viewer that is meant to fill the entire screen with the photo itself and no distractions.
-
-
To enable this option on a fixed header or footer, add the data-fullscreen attribute to the element.
While all form elements are now tested to work correctly within static toolbars as of jQuery Mobile 1.1, we recommend extensive testing when using form elements within fixed toolbars or within any position: fixed elements. This can potentially trigger a number of unpredictable issues in various mobile browsers, Android 2.2/2.3 in particular (detailed in Known issues in Android 2.2/2.3, below).
-
-
Changes in jQuery Mobile 1.1
-
-
Prior to version 1.1, jQuery Mobile used dynamically re-positioned toolbars for the fixed header effect because very few mobile browsers supported the position:fixed CSS property, and simulating fixed support through the use of "fake" JavaScript overflow-scrolling behavior would have reduced our browser support reach, in addition to feeling unnatural on certain platforms. This behavior was not ideal, and jQuery Mobile 1.1 took a new approach to fixed toolbars that allows much broader support. The framework now offers true fixed toolbars on many popular platforms, while gracefully degrading non-supporting platforms to static positioning.
-
-
Polyfilling older platforms
-
The fixed toolbar plugin degrades gracefully in platforms that do not support CSS position:fixed properly, such as iOS4.3. If you still need to support fixed toolbars on that platform (with the show/hide behavior) included in previous releases, Filament Group has developed a polyfill that you can use.
Just include the CSS and JS files after your references to jQuery Mobile and Fixed toolbars will work similarly to jQuery Mobile 1.0 in iOS4.3, with the inclusion of the new API for the 1.1 fixedtoolbar plugin.
-
-
If you have any improvements to suggest, fork the gist on github and let us know!
-
-
Known issue with form controls inside fixed toolbars, and programmatic scroll
-
An obscure issue exists in iOS5 and some Android platforms where form controls placed inside fixed-positioned containers can lose their hit area when the window is programatically scrolled (using window.scrollTo for example). This is not an issue specific to jQuery Mobile, but because of it, we recommend not programatically scrolling a document when using form controls inside jQuery Mobile fixed toolbars. This ticket from the Device Bugs project tracker explains this problem in more detail.
-
-
Known issues in Android 2.2/2.3
-
Android 2.2/2.3's implementation of position: fixed; can, in conjunction with seemingly unrelated styles and markup patterns, cause a number of strange issues, particularly in the case of position: absolute elements inside of position: fixed elements. While we've done our best to work around a number of these unique bugs within the scope of the library, custom styles may cause a number of issues.
-
-
Form elements elsewhere on the page—select menus in particular—can fail to respond to user interaction when an empty absolute positioned element is placed within a fixed position element. In rare cases—and specific to Android 2.2—this can cause entire pages to fail to respond to user interaction. This can seemingly be solved by adding any character to the absolute positioned element, including a non-breaking space, and in some cases even whitespace.
-
The above-described issue can also be triggered by an absolute positioned image inside of a fixed position element, but only when that image is using something other than its inherent dimensions. If a height or width is specified on the image using CSS, or the image src is invalid (thus having no inherent height and width), this issue can occur. If an image that is inherently, say, 50x50 pixels is placed in a fixed element and left at its inherent dimensions, this issue does not seem to occur.
-
When a position: fixed element appears anywhere on a page, most 2D CSS transforms will fail. Oddly, only translate transforms seem unaffected by this. Even more oddly, this issue is solved by setting a CSS opacity of .9 or below on the parent of the fixed element.
-
Combinations of position: fixed and overflow properties are best avoided, as both have been known to cause unpredictable issues in older versions of Android OS.
-
Any element that triggers the on-screen keyboard, when placed inside a position: fixed element, will fail to respond to user input when using anything other than the default keyboard. This includes Swype, XT9 or, it seems, any input method apart from the standard non-predictive keyboard.
-
-
-
While we will continue to try to find ways to mitigate these bugs as best we can, we currently advise against implementing fixed toolbars containing complicated user styles and form elements without extensive testing in all versions of Android's native browser.
-
-
-
No longer supported: touchOverflowEnabled
-
Prior to jQuery Mobile 1.1, true fixed toolbar support was contingent on native browser support for the CSS property overflow-scrolling: touch, which is currently only supported in iOS5. As of version 1.1, jQuery Mobile no longer uses this CSS property at all. We've removed all internal usage of this property in the framework, but we've left it defined globally on the $.mobile object to reduce the risk that its removal will cause trouble with existing applications. This property is flagged for removal, so please update your code to no longer use it. The support test for this property, however, remains defined under $.support and we have no plans to remove that test at this time.
-
-
-
+
As of jQuery Mobile 1.4.0 the functionality of the fixedtoolbar widget has been moved to the toolbar widget.
+
1.0
-
-
- This determines whether the toolbar is visible or not when its parent page is shown.
-
This option is also exposed as a data attribute: data-visible-on-page-show="false".
-
-
-
-
- This determines whether user-scaling should be disabled on pages that contain fixed toolbars.
-
This option is also exposed as a data attribute: data-disable-page-zoom="false".
-
-
-
-
- The transition that should be used for showing and hiding a fixed toolbar. Possible values are "none", "fade", and "slide" (or you can write a CSS transition of your own and use that too).
-
This option is also exposed as a data attribute: data-transition="fade".
-
-
-
-
- Fullscreen fixed toolbars sit on top of the content at all times when they are visible, and unlike regular fixed toolbars, fullscreen toolbars do not fall back to static positioning when toggled, instead they disappear from the screen entirely. Fullscreen toolbars are ideal for more immersive interfaces, like a photo viewer that is meant to fill the entire screen with the photo itself and no distractions.
-
This option is also exposed as a data attribute: data-fullscreen="true".
-
Note: While the data attribute syntax for this option has not changed, it is now only supported on the toolbar element itself, and not the page element.
-
-
-
-
- Enable or disable the user's ability to toggle toolbar visibility with a tap on the screen (or a click, for mouse users).
-
This option is also exposed as a data attribute: data-tap-toggle="false".
-
Note: This behavior was formerly configurable as follows, but as of version 1.1 this syntax is no longer supported: $.mobile.fixedToolbars.setTouchToggleEnabled(false);
-
-
-
-
- A list of jQuery selectors that, when tapped, will not cause the toolbars to be toggled.
-
-
-
-
- A list of jQuery selectors that should cause the toolbars to hide while focused, except if they are in a fixed toolbar.
-
-
-
-
- Since toolbars can vary in height depending on the content they contain, this option automatically updates the padding on the page element to ensure that fixed toolbars have adequate space in the document when they are statically positioned, and when scrolled to the top or bottom of the page. When enabled, the padding updates during many operations, such as pageshow, during page transitions, and on resize and orientationchange. As an optimization, we would recommend that you consider disabling this option and adding a rule to your CSS to set the padding of the page div to match the EM height of your toolbars, such as .ui-page-header-fixed { padding-top: 4.5em; }.
-
This option is also exposed as a data attribute: data-update-page-padding="false".
-
-
-
-
- CSS position: fixed support is very difficult to test; in fact, at the time of version 1.1 release, there was no known way to reasonably test for fixed support without turning up false positives or negatives in certain popular browsers. This option is a function that attempts to opt-out some popular platforms that are known to be troublesome with position: fixed . Often, these platforms support position: fixed partially, which can be worse than not supporting it at all. If overriding this option with your own blacklist logic, you simply need to provide a function that returns a true or false result when called upon initialization. You must set it on mobileinit, so that it applies when the plugin is initially created.
-
-$( document ).on( "mobileinit", function() {
- $.mobile.fixedtoolbar.prototype.options.supportBlacklist = function() {
- var result;
- // logic to determine whether result should be true or false
- return result;
- };
-})
-
-
-
-
-
- This is used to define the selectors (element types, data roles, etc.) that will automatically be initialized as collapsibles. To change which elements are initialized, bind this option to the mobileinit event:
-
-
-
-
- Triggered when a fixed toolbar is created
-
-
-
-
-
-
-
-
-
-
-
- show the toolbar
-
Note: Prior to version 1.1, the following syntax was used to show the toolbars, but it is no longer supported:
-$.mobile.fixedToolbars.show(true);
-
-
-
- hide the toolbar (if it's not a fullscreen toolbar, it'll toggle back to static positioning, which may or may not be hidden from view depending on scroll)
-
-
-
- calls either the show or the hide method, depending on whether the toolbar is visible.
-
-
-
- update the padding (either top or bottom, depending on if the toolbar is a header or a footer) of the page element parent of the toolbar to match the height of the toolbar.
-
There is also an updatelayout event that can be used to trigger the toolbars to re-position. Developers who are building dynamic applications that inject content into the current page can also manually trigger this updatelayout event to ensure components on the page update in response to the new content that was just added. This event is used internally in the collapsible and listview filter plugins and is powerful because it's not toolbar-specific -- any widget can be built to listen for the updatelayout event to update the widget in response.
-
-
-
- destroy at fixedtoolbar (restore the element to its initial state)
-
-
-
-
- A basic example of a page with fixed toolbars.
-
-
diff --git a/entries/flipswitch.xml b/entries/flipswitch.xml
new file mode 100644
index 00000000..1c42d386
--- /dev/null
+++ b/entries/flipswitch.xml
@@ -0,0 +1,172 @@
+
+
+
+ Flipswitch Widget
+ Creates a widget
+
+
Flip switches
+
The flip switch is an alternative look to the checkbox or the two-option select menu. It can be toggled by a click or a swipe.
+
To create a flip switch add the attribute data-role="flipswitch" to a checkbox input or to a select which has two option values.
+
+
+
+
+
+ ui-flipswitch: The outermost container for flipswitch. Additionally, ui-flipswitch-active class will be applied in case flipswitch is in active
+
+
+ ui-flipswitch-on: On state label of flipswitch
+
+
+ ui-flipswitch-off: Off state label of flipswitch
+
+
+ ui-flipswitch-input: Input checkbox element for flipswitch
+
+
+
+
+
+
Checkbox-based flipswitch
+
Use the following markup to create a flipswitch based on a checkbox input:
+
+
+ The labels for the flipswitch are controlled by the onText and offText options.
+
Select-based flipswitch
+
You can also create a flipswitch based on a select element:
+
+
+ The labels for the flipswitch are controlled by the labels of the select element's option elements. The first option is used for the inactive, "off" state, and the second option is used for the active, "on" state.
+
+
Custom labels
+
You can customize the labels displayed by the widget either using the onText and offText options if the widget is based on a checkbox, or using the text inside the first two option elements if the widget is based on a select.
+
The location of the text inside the two labels is specified manually in the widget's structural CSS. Thus, if you use labels that are longer than "On" and "Off", you may have to override the default text placement using the following custom CSS:
+
+
Depending on your choice of labels, you may also have to provide custom CSS to override the default width for the flipswitch:
+
+
+
+
The widget adds a wrapper div around the input. In addition to the original element, the wrapper also contains two span elements where the two labels are stored. The first span is styled as a button with the text for the active state appearing outside the button's bounding box to the left. To make the reachable by tabbing, you can add the tabindex="1" attribute to the first span.
+
In the example below, pre-rendered markup for a is provided. The attribute data-corners="false" is explicitly specified, since the absence of the ui-corner-all class on the wrapper element indicates that the "corners" widget option is to be false.
+ Applies the theme button border-radius if set to true.
+
This option is also exposed as a data attribute: data-corners="false".
+
+
+
+
+
+
+
+
+
+
When the widget is based on a checkbox rather than a select the value of this option is used as the label for the "Off" state.
+
This option is also exposed as a data attribute: data-off-text="Go"
+
+
+
+
+
When the widget is based on a checkbox rather than a select the value of this option is used as the label for the "On" state.
+
This option is also exposed as a data attribute: data-on-text="Go"
+
+
+
+
+ It is difficult to write custom CSS for the wrapper div around the native input element generated by the framework. This option allows you to specify one or more space-separated class names to be added to the wrapper div element by the framework.
+
This option is also exposed as a data attribute: data-wrapper-class="custom-class".
If you manipulate a via JavaScript, you must call the refresh method on it to update the visual styling.
+
+
+
+
+ A basic example of a checkbox in a fieldcontainer
+
+
+
+
diff --git a/entries/footer.xml b/entries/footer.xml
index 5fba3d4a..83d172c2 100644
--- a/entries/footer.xml
+++ b/entries/footer.xml
@@ -2,73 +2,10 @@
Footer Widget
- Creates a footer widget
+ See Toolbar Widget
- The Footer bar is usually the last element inside each mobile page, and tends to be more freeform than the header in terms of content and functionality, but typically contains a combination of text and buttons.
-
-
Footer bar structure
-
The footer bar has the same basic structure as the header except it uses the data-role attribute value of footer.
The footer toolbar will 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 difference is that the footer is designed to be less structured than the header to allow more flexibility, so the framework doesn't automatically reserve slots for buttons to the left or right as it does in headers.
-
Since footers do not have the same prescriptive markup conventions as headers, we recommend using layout grids or writing custom styles to achieve the design you want.
-
-
Adding buttons
-
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.
This creates this toolbar with buttons sitting in a row
-
-
-
Note that .ui-bar should not be added to header or footer bars that span the full width of the page, as the additional padding will cause a full-width element to break out of its parent container. To add padding inside of a full-width toolbar, wrap the toolbar's contents in an element and apply the padding to that element.
-
-
To group buttons together into a button set, wrap the links in a wrapper with data-role="controlgroup" and data-type="horizontal" attributes.
Form elements and other content can also be added to toolbars. Here is an example of a select menu inside a footer bar. We recommend using mini-sized form elements in toolbars by adding the data-mini="true" attribute:
-
-
-
Fixed & Persistent footers
-
In situations where the footer is a global navigation element, you may want it to appear fixed so it doesn't scroll out of view. It's also possible to make a fixed toolbar persistent so it appears to not move between page transitions. This can be accomplished by using the persistent footer feature included in jQuery Mobile.
-
To make a footer persistent 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. 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.
-
+
As of jQuery Mobile 1.4.0 the functionality of the footer widget has been moved to the toolbar widget.
+
1.0
-
- A basic example of a footer
-
-
diff --git a/entries/grid-layout.xml b/entries/grid-layout.xml
index 96bd1345..19ca9a7f 100644
--- a/entries/grid-layout.xml
+++ b/entries/grid-layout.xml
@@ -20,42 +20,42 @@
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:
-
-<div class="ui-grid-a">
- <div class="ui-block-a"><strong>I'm Block A</strong> and text inside will wrap</div>
- <div class="ui-block-b"><strong>I'm Block B</strong> and text inside will wrap</div>
-</div><!-- /grid-a -->
-
+
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 container of each of the two buttons inside to stretch them each to 50% of the screen width:
Please note that the framework adds left and right margin to buttons in a grid. For a single button you can use a container with class ui-grid-solo and wrap the button in a div with class ui-block-a like the example below. This way the button will get the same margin.
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.
+
+
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-a to apply the background and font styling for the "a" 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.
@@ -63,42 +63,42 @@
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.
This will produce a 33/33/33% grid for our content.
-
+
And an example of a 3 column grid with buttons inside:
-
+
Four-column grids
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.
-
+
Five-column grids
A five-column, 20/20/20/20/20% grid is created by specifying class=ui-grid-d on the parent and adding a fifth block. Note: These blocks are also styled with theme classes so the grid layout is clearly visible.
-
+
-
+
Multiple row grids
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:
Grids in toolbars
-
+
Grids are helpful for creating layouts within a toolbar. Here's a footer with a 4 column grid.