Page Navigation Notification


/ Published in: JavaScript
Save to your folder(s)



Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.