Created
September 23, 2016 02:58
-
-
Save yagamicoder/3be3b7d20a5accc33c63d26859b6194a to your computer and use it in GitHub Desktop.
Main js - alt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('#navigation ul li a').each(function(event){ | |
var mylink = $(this).attr("href"); | |
var url = window.location; | |
//If there is a match, apply a class of current, otherwise, remove the class of current | |
if(url == mylink){ | |
$(this).addClass('current'); | |
}else{ | |
$(this).removeClass('current'); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment