jQuery Mobile: Button on the right hand side of the header

Many app designers like to put a button on the top of the page.

For example, we put an info button on the right hand side of the header bar.

<!DOCTYPE html>
<html>
<head>
    <link href='http://code.jquery.com/mobile/1.4.1/jquery.mobile-1.4.1.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.1/jquery.mobile-1.4.1.min.js'></script>
    <title>Codecrawl</title>
</head>
<body>
<div data-role='page'>
    <div data-role='header'>
        <h1>I'm a header</h1>
        <a href='#' data-icon='info' class='ui-btn-right'>Info</a>
        <div data-role='navbar'>
            <ul>
                <li><a href='#'>One</a></li>
                <li><a href='#'>Two</a></li>
                <li><a href='#'>Three</a></li>
            </ul>
        </div><!-- /navbar -->
    </div><!-- /header -->

    <div data-role='content'>
        <p>You can put your content here...</p>
    </div>

    <div data-role='footer'>
        <h1>My Footer</h1>
    </div>
</div>

</body>
</html>
Try The Code

The line needed for the info button is:

<a href='#' data-icon='info' class='ui-btn-right'>Info</a>

button_r

Series Navigation<< jQuery Mobile: Navigation bar
jQuery Mobile: Navigation bar in the footer >>