Footer configuration

Footer bar structure

The footer bar has the same basic structure as the header except it uses the data-role attribute value of footer.

<div data-role="footer"> 
	<h4>Footer content</h4> 
</div> 

The footer toolbar will be be themed with the "a" swatch by default (black in the default theme) but you can easily set the theme swatch color.

Footer content

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.

Adding buttons

Any link added to the footer will be automatically turned into a button but any valid button markup will work.. To save space, buttons in toolbars are automatically set to inline styling so the button is only as wide as the text and icons they contain.

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

To group the buttons together into a button set, wrap the links in a wrapper with data-role="controlgroup" data-type="horizontal" attributes.

<div data-role="controlgroup" data-type="horizontal">

This creates a grouped set of buttons:

Adding form elements

Form elements and other content can also be added to toolbars. Here is an example of a select menu inside a footer bar:

Persistent footers

In situations where the footer is being used as a global navigation element, you may want the footer to appear like it is fixed in place between page transitions. This can be accomplished by using the persistent footer feature included in jQuery Mobile. To make a footer appear to stay in place between transitions, simply add the data-id attribute to the footer of both 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 sticky so they are in view during the transition.

If you want the footer to appear persistent as you navigate between pages (especially useful if using a nav bar, see below), you can achieve this effect by adding a data-id attribute to each page that should have the persistent footer. Giving a set of pages the same data-id attribute value (like "foo"), tells the framework to use the persistent footer transition when animating.