Add navigation bar
Description
The following code shows how to add navigation bar.
Example
<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'>
window.onload=function(){<!-- ww w .j a va2 s .c o m-->
$('.add').bind('click', function () {
var myNavbar = $('<div data-role="navbar"><ul><li><a href="">One</a></li><li><a href="">Two</a></li></ul></div>').appendTo('.ui-content');
$('.ui-content').append(myNavbar).trigger('create');
});
}
</script>
</head>
<body>
<link rel="stylesheet"
href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
<script src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
<script
src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
<div data-role="page">
<div data-role="content">
<a href="#" class="add">Click to add a navbar</a>
</div>
</div>
</body>
</html>