Hi all using JQuery to hide the overflow of list items and it’s working well but the items I displaying in rows of 2 instead of all in the same row.
Anyone know why it might be doing this?
Here is the full source code:
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.css" />
<script type="text/javascript" src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
<script type="text/javascript" src="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.js"></script>
</head>
<body>
<div data-role="page">
<div data-role="header">
<h1>Page Title</h1>
</div><!-- /header -->
<div data-role="content">
<p>Page content goes here.</p>
</div><!-- /content -->
<div data-role="footer">
<div data-role="navbar">
<ul class="footeritems">
<li><a href="#" data-icon="grid" data-iconpos="top">One</a></li>
<li><a href="#" data-icon="grid" data-iconpos="top">Two</a></li>
<li><a href="#" data-icon="grid" data-iconpos="top">Three</a></li>
<li><a href="#" data-icon="grid" data-iconpos="top">Four</a></li>
<li><a href="#" data-icon="grid" data-iconpos="top">Five</a></li>
<li><a href="#" data-icon="grid" data-iconpos="top">Six</a></li>
<li><a href="#" data-icon="grid" data-iconpos="top">Seven</a></li>
</ul>
</div>
</div><!-- /footer -->
</div><!-- /page -->
<script>
$(document).ready(function() {
$("ul.footeritems li:gt(3)").remove();
$("ul.footeritems").listview('refresh');
});
</script>
</body>
</html>
this is because jquery mobile css supports footer navbar to have a maximum of five list items in a row. if there are more items it breaks it into further lines. remove any one list item and it will come in a single row