Posted By

damanlovett on 08/10/10


Tagged

jquery


Versions (?)

Page Navigation Notification


 / Published in: JavaScript
 

  1. // Side Navigation Select
  2.  
  3. $('a').addClass(function() {
  4. if ($(this).attr('class')==$('body').attr('id')) {
  5. return 'active';
  6. }
  7. });
  8.  
  9. // NOTE:
  10. // add id that is the name of the page to body tag i.e. <body id="home">
  11. // create active css with styles active {text-decoration: underline;}

Report this snippet  

You need to login to post a comment.