I have a menu which has a ul
like:
<ul class="tabs pull-right">
<% if user_signed_in? %>
<li class="active"><a href="/dashboard">Dashboard</a></li>
<% else %>
<li class="active"><a href="/">Home</a></li>
<% end %>
<% if user_signed_in? %>
<li><a href="/upgrade">Upgrade</a></li>
<% else %>
<li><a href="/pricing">Pricing</a></li>
<% end %>
My jquery code is
$(document).ready(function(){
$(".tabs li").click(function() {
$(".tabs li").removeClass('active');
var selected_tab = $(this).find("a").attr("href");
$(this).addClass("active");
$(selected_tab).fadeIn();
return false;
});
});
My css
.tabs_wrapper { width: 900px; }
.tabs_container { border-bottom: 0px solid #ccc; }
.tabs { list-style: none; padding: 5px 0 4px 0; margin: 0 0 0 10px; font: 1.15em arial; }
.tabs li { display: inline; }
.tabs li a { border: 1px solid #ccc;
padding: 4px 6px; text-decoration: none;
background-color: #eeeeee; border-bottom: none;
outline: none; border-radius: 5px 5px 0 0; -moz-border-radius: 5px 5px 0 0;
-webkit-border-top-left-radius: 5px;
-webkit-border-top-right-radius: 5px; }
.tabs li a:hover { background-color: #dddddd; padding: 4px 6px; }
.tabs li.active a { border-bottom: 1px solid #fff; background-color: #fff; padding: 4px 6px 5px 6px; border-bottom: none; }
.tabs li.active a:hover { background-color: #eeeeee; padding: 4px 6px 5px 6px; border-bottom: none; }
My problem is when I try to click pricing, the page is activating but in menu it is showing home...it is not activating the pricing tab in menu .... can any one of u tell what's the problem?