footer bar has the same basic structure as the header except it uses the
data-role attribute value of
<div data-role="footer"> <h4>Footer content</h4> </div>
footer toolbar will be be themed with the "a" swatch by default (black in the default theme) but you can easily set the theme swatch color.
The page footer is very similar to the header in terms of options and configuration. The primary differences are that the footer is designed to be less structured than the header to allow for more flexibility, so the framework doesn't automatically place buttons to the left or right based on source order as it does in the header. Since footers do not have the same prescriptive markup contentions as headers, use layout grids or custom styles to achieve the design you want in a footer.
Any link or valid button markup added to the footer will automatically be turned into a button. To save space, buttons in toolbars are automatically set to inline styling so the button is only as wide as the text and icons it contains.
By default, toolbars don't have any padding to accommodate nav bars and other widgets. To include padding on the bar, add a
class="ui-bar" to the footer.
<div data-role="footer" class="ui-bar"> <a href="index.html" data-role="button" data-icon="delete">Remove</a> <a href="index.html" data-role="button" data-icon="plus">Add</a> <a href="index.html" data-role="button" data-icon="arrow-u">Up</a> <a href="index.html" data-role="button" data-icon="arrow-d">Down</a> </div>
This creates this toolbar with buttons sitting in a row
.ui-barshould 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 we recommend wrapping the toolbar's contents in an element, and applying the padding to that element instead.
To group buttons together into a button set, wrap the links in a wrapper with
<div data-role="controlgroup" data-type="horizontal">
This creates a grouped set of buttons:
Form elements and other content can also be added to toolbars. Here is an example of a select menu inside a footer bar:
In situations where the footer is a global navigation element, you may want it to appear fixed in place between page transitions. This can be accomplished by using the persistent footer feature included in jQuery Mobile.
To make a footer stay in place between transitions, add the
data-id attribute to the footer of all relevant pages and use the same
id value for each. For example, by adding
data-id="myfooter" to the current page and the target page, the framework will keep the footer anchors in the same spot during the page animation. PLEASE NOTE: This effect will only work correctly if the header and footer toolbars are set to
data-position="fixed" so they are in view during the transition.