Skip to content

Instantly share code, notes, and snippets.

@Nikolasgrizli
Forked from agragregra/jquery-active.js
Created March 19, 2018 05:38
Show Gist options
  • Save Nikolasgrizli/f1adc8ebc759bdf198bf0b8bcc7055b2 to your computer and use it in GitHub Desktop.
Save Nikolasgrizli/f1adc8ebc759bdf198bf0b8bcc7055b2 to your computer and use it in GitHub Desktop.
jQuery Active Menu
//Active menu
$("li a").each(function() {
if (this.href == window.location.href) {
$(this).addClass("active");
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment