In jQuery mobile I have tabs bar with three values, when i switch between the categories it just light a second
i want when i click on any tab, the tab will be set active with different color
i use this jQuery code :
$(document).delegate('.ui-navbar ul li > a', 'click', function () {
$(this).closest('.ui-navbar').find('a').removeClass('ui-navbar-btn-active');
//$('.ui-navbar ul li > a').removeClass('ui-navbar-btn-active');
$(this).addClass('ui-navbar-btn-active');
//$('.content_div').hide();
$('#' + $(this).attr('data-href')).show().siblings('.content_div').hide();
});
Html :
<div class="boxshadow" >
<div data-role="navbar">
<ul>
<li ><a href="javascript:;" data-href="a" data-theme="a" class="ui-btn-active ui-state-persist" class="ui-navbar-btn-active">Shopping</a></li>
<li><a href="javascript:;" data-href="b" data-theme="a">
Entertainment</a></li>
<li><a href="javascript:;" data-href="c" data-theme="a">Restaurants</a></li>
</ul>
</div><!-- /navbar -->