jQuery Mobile: Fixed footer

Using our earlier example, we put a fixed footer on both of the pages.

Fixed footer can be added with the following markup:

<div data-role="footer" data-position="fixed">
	<h1>Fixed Footer!</h1>
</div>

On page one, the code will be as below:

<div data-role='page' id='pageone'>
    <div data-role='header'><h1>My Mobile App</h1></div>
    <div data-role='content'>
        <p>Your page one content here</p>
        <a href='#pagetwo' data-role='button'>Click Me</a>
    </div>
    <div data-role='footer' data-position="fixed">
	<h1>Fixed Footer!</h1>
</div>
Try The Code Fixed Footer Code Block
<!DOCTYPE html>
<html>
<head>
    <link href='http://code.jquery.com/mobile/1.4.0/jquery.mobile-1.4.0.min.css' rel='stylesheet'/>
    <script src='http://code.jquery.com/jquery-1.10.2.min.js'></script>
    <script src='http://code.jquery.com/mobile/1.4.0/jquery.mobile-1.4.0.min.js'></script>
    <title>Upwhere</title>
</head>
<body>
<div data-role='page' id='pageone'>
    <div data-role='header'><h1>My Mobile App</h1></div>
    <div data-role='content'>
        <p>Your page one content here</p>
        <a href='#pagetwo' data-role='button'>Click Me</a>
    </div>
    <div data-role='footer' data-position='fixed'>
	<h1>Fixed Footer!</h1>
</div>
</div>
<div data-role='page' id='pagetwo'>
    <div data-role='header'><h1>My Mobile App</h1></div>
    <div data-role='content'>
        <p>You are at page two!</p>
        <a href='#pageone' data-role='button'>Go Back</a>
    </div>
    <div data-role='footer' data-position="fixed">
	<h1>Fixed Footer!</h1>
</div>
</div>

</body>
</html>

 

 

Series Navigation<< jQuery Moble: Page movement
jQuery Mobile: Dialog box >>