I am working on an Jquery mobile app using Cordova/PhoneGap where I want a navbar directly under my header, with a fixed position, so the navbar doesn't scroll with the content. If I place the navbar inside the header, it inherits the style of the header and the css of the navbar doesn't behave like it should. E.g. there is no highlighting when I click an item in the navbar, it just stays the same color as the header itself (black in my case) and there are also no more visible borders. Only the text inside the item responds to a click. I looked up a few examples, but none of them seem to work for me:
Example one
Example two
Here's my code for the page:
<div data-role="page" id="page_tasks">
<div data-role="header" data-id="header" data-theme="b" data-position="fixed">
<h1>Tasks</h1>
<a href="#leftmenu" class="ui-btn ui-btn-left ui-btn-icon-notext ui-icon-bars"></a>
<div data-role="navbar">
<ul>
<li class="iconnavbar"><a href="#" data-href="overdue">1</a></li>
<li class="iconnavbar"><a href="#" data-href="today">2</a></li>
<li class="iconnavbar"><a href="#" data-href="thisweek">3</a></li>
<li class="iconnavbar"><a href="#" data-href="nextweek">4</a></li>
<li class="iconnavbar"><a href="#" data-href="later">5</a></li>
<li class="iconnavbar"><a href="#" data-href="finished">6</a></li>
</ul>
</div>
</div>
<div data-role="main" class="ui-content">
<!-- page content, unrelated -->
</div>
</div>
CSS for class iconnavbar is as follows:
.iconnavbar {
width: 16.66% !important;
clear: none !important;
}
But that shouldn't have any influence on my problem. In fact, I also tried to strip down everything so it looked exactly like one of the examples and I still got the same bad result.
So how do I fix this problem? Or is there a better/alternative way to add a navbar to the top of my page with a fixed position like in the examples?
Below is a screenshot of how the menu looks on an iPhone and item 3 is pressed.