page title/logo
or buttons like home, information etc. It can have one/two buttons, but the footer
bar has no limit on having buttons.
Eg: The below code will add a "Home"
button on left side and a "Search"
button on right of the header title text.
[html]
<div data-role="header">
<h1>Home</h1>
<a href="#anylink" class="ui-btn ui-icon-home ui-btn-icon-left">Home</a>
<a href="#anylink" class="ui-btn ui-icon-search ui-btn-icon-right">Search</a>
</div>
[/html]
Eg: The below code will add only a button to the left of the header title.
[html]
<div data-role="header">
<a href="#anylink" class="ui-btn ui-btn-left ui-icon-home ui-btn-icon-left">Home</a>
<h1>Home</h1>
</div>
[/html]
Eg:The below code will add only a button to the right of the header title.
[html]
<div data-role="header">
<h1>Home</h1>
<a href="#anylink" class="ui-btn ui-btn-right ui-icon-home ui-btn-icon-left">Search</a>
</div>
[/html] data-position
attribute to element. The position of header and the footer can be done in three ways.
With the content of the page, headers and footers are inlined.(Its default).
[html]
<div data-role="header" data-position="inline"></div>
<div data-role="footer" data-position="inline"></div>
[/html]
Headers and footers are at fixed position i.e at the top and bottom of the page.
[html]
<div data-role="header" data-position="fixed"></div>
<div data-role="footer" data-position="fixed"></div>
[/html]
Acts like fixed, headers and footers remain at the top and bottom positions respectively, and also over the content of the page. When tapped on the screen, headers and footers are shown and hidden for both fixed and fullscreen positions.
[html]
<div data-role="header" data-position="fixed" data-fullscreen="true"></div>
<div data-role="footer" data-position="fixed" data-fullscreen="true"></div>
[/html]