Last active
December 15, 2015 15:59
-
-
Save rewfergu/5285532 to your computer and use it in GitHub Desktop.
JavaScript active link
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
var thisPage = window.location.pathname; | |
var pageArray = thisPage.split('/'); | |
$('nav ul li.' + pageArray[1]).addClass('active'); | |
$('nav ul li .sub a[href="' + thisPage + '"]').addClass('active'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment