Sunday, December 18, 2011

Header Toolbar of jQuery Mobile

In jQuery Mobile, there are two standard types of toolbars: Headers and Footers.
  • The Header bar serves as the page title, and typically contains a page title and up to two buttons.
  • The Footer bar is usually the last element inside each mobile page, and tends to be more freeform than the header in terms of content and functionality, but typically contains a combination of text and buttons.


Example of jQuery Mobile Header bar:
Header Toolbar of jQuery Mobile

<!DOCTYPE html>
<html>
<head>
<title>jQuery Mobile Web Page: Toolbar</title>
<link rel="stylesheet" href="http://code.jquery.com/mobile/latest/jquery.mobile.css" />
<script src="http://code.jquery.com/jquery.min.js"></script>
<script src="http://code.jquery.com/mobile/latest/jquery.mobile.min.js"></script>
</head>
<body>

<div data-role="page" id="home">
<div data-role="header">
<!-- Example of Toolbar -->
<!-- Left Button -->
<a href="#home" data-icon="arrow-l">Home</a>
<!-- Title -->
<h1>Toolbar</h1>
<!-- Left Button -->
<a href="#secondpage" data-icon="arrow-r">Second</a>
<!-- End of Toolbar -->
</div>
<div data-role="content">
<p>Hello jQuery Mobile Toolbar</p>
<p>it's a basic mobile web page utilize jQuery Mobile implementing Toolbar.</p>
<a href="#secondpage">Jump to Second Page</a>
</div>
<div data-role="footer">
<h4><a href="http://mobile-web-app.blogspot.com/">http://mobile-web-app.blogspot.com/</a></h4>
</div>
</div>

<div data-role="page" id="secondpage">
<div data-role="header">
<!-- Example of Toolbar -->
<!-- Left Button -->
<a href="#home" data-icon="arrow-l">Home</a>
<!-- Title -->
<h1>Toolbar</h1>
<!-- Left Button -->
<a href="#secondpage" data-icon="arrow-r">Second</a>
<!-- End of Toolbar -->
</div>
<div data-role="content">
<p>It's the SECOND PAGE</p>
<a href="#home">Back to Home Page</a>
</div>
<div data-role="footer">
<h4><a href="http://mobile-web-app.blogspot.com/">http://mobile-web-app.blogspot.com/</a></h4>
</div>
</div>

</body>
</html>



Related:
- Footer Toolbar of jQuery Mobile

No comments:

Post a Comment