jquery - update nav without reloading -
this question has answer here:
i'm looking simple method swap active state (color) of navigation without page reload.
- this should happen when 1 nav button pressed. should change it's state active, , change other buttons non-active state.
- i'm new jquery, seems there have been simple solution there. if there sure haven't come across it.
i believe answer have been trivial put yourself, anyway... .click() , .addclass() it.
$('nav a').on('click', function() { $('nav a') .removeclass('active') .filter(this) .addclass('active'); });
css
a.active { color: #ff0000; }
Comments
Post a Comment