jquery - update nav without reloading -


this question has answer here:

i'm looking simple method swap active state (color) of navigation without page reload.

  1. this should happen when 1 nav button pressed. should change it's state active, , change other buttons non-active state.
  2. 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

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -