Hi!
Yeah I know I’m back again with another jquery issue :D.
I’m almost done with coding this template but I’m having some problems with the following:
- There is a class called 'active' that is added to the first anchor in navigation, this is done with jQuery, so far so good.
- When you click on another link the jQuery should give the clicked link the class 'active' and remove it from the 'previous' link.
All of this works just fine, but the class ‘active’ isn’t removed from the previous link.
Here’s my jQuery code:
$(document).ready(function(){ $('.nav a:first').addClass("active"); $('.nav a').click(function(){ $('.nav a').removeClass("active"); $(this).addClass("active"); return false; }); );
Anyone has an idea why it doesn’t work?