Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Tabs – mark active and animation Re: Tabs – mark active and animation

#122666
CarlRosell
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’);