Search Blog

Simple bit of jQuery to add an active class to the current navigation item based on the page url.

jQuery("nav a").each(function() {   
	    if (this.href == window.location.href) {
	        jQuery(this).addClass("active-sidebar");
	    }
	});