December 2013
Intermediate to advanced
384 pages
9h 54m
English
<div data-role="header" data-position="fixed"> <h1>Header</h1></div> ... <div data-role="footer" data-position="fixed"> <h4>Footer</h4></div>
By default, both the header and the footer flow with the content, meaning that if you scroll the content up or down, the header scrolls with the content. Often, you want the header, footer, or both to stay in a fixed position on the device screen so that it is always displayed. jQuery Mobile makes that adjustment simple to make.
To make the header or footer—or a toolbar for that matter—fixed, all you have to do is add the data-position="fixed" attribute to the <div>. This make them stay in place, the header at the top of the page and ...
Read now
Unlock full access