Home › Forums › JavaScript › Tabs – mark active and animation › Re: Tabs – mark active and animation
January 29, 2013 at 4:35 am
#122666
Participant
first off you need a class with the name .active and then do something with it so you can see if its really active.
.active{
color:red;
}
then just remove the :first and parent() from your click function. you want to remove every class active and then make the clicked a itself active.
$(‘nav a’).click(function(){
$(‘nav a’).removeClass(‘active’);
$(this).addClass(‘active’);