Saturday, October 29, 2011

Multi-page jQuery Mobile web page

In jQuery Mobile, each HTML file can have more than one page. Each page defined inside div with data-role="page", and identified by id attribute.

Example: A html of jQuery Mobile with two page.

Multi-page jQuery Mobile web page

<!DOCTYPE html>
<html>
<head>
<title>Basic jQuery Mobile Web Page</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">
<h1>My first web Home page</h1>
</div>
<div data-role="content">
<p>Hello ALL</p>
<p>it's a basic mobile web page utilize jQuery Mobile</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">
<h1>My first web Home page</h1>
</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>

No comments:

Post a Comment