External toolbars - jQuery Mobile Demos

Back

# External header

# External toolbars

The header and footer on this page are positioned outside the page. They are before and after the page within the body. These Toolbars will remain in the dom until manually removed.

## Markup

The markup for external toolbars is identical to normal toolbars, you just place the toolbar outside the page within the body of your page

## Auto init

Because these toolbars are not within the page they will not auto initalize. You must call the toolbar plugin yourself.

    $(function(){
    	$( "[data-role='header'], [data-role='footer']" ).toolbar();
    });

## Theme

Since external toolbars are outside the page they don't inherit a theme from the page. This means you always have to set a theme for them. You can use the `data-theme` attribute for this or set the `theme` option when you call the plugin:

    $(function(){
    	$( "[data-role='header']" ).toolbar({ theme: "a" });
    });

## Ajax navigation

Because these toolbars are not within the page they will remain in the DOM until manually removed.

Toolbars not within a page will not be pulled into the DOM during Ajax navigation.

## Fixed external toolbars

External toolbars can also be set to fixed positioning just like normal toolbars: External fixed toolbars

# External footer