Created
July 24, 2014 11:29
-
-
Save DenimTornado/a1cb595dcc9266254c7d to your computer and use it in GitHub Desktop.
Set 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
(function () { | |
var left_links = document.getElementById("menu").getElementsByTagName('a'); | |
var current_url = document.location; | |
for (var i = 0; i < left_links.length; i++) { | |
if (current_url.pathname == left_links[i].pathname && current_url.host == left_links[i].host ) { | |
left_links[i].className += ' active'; | |
} | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment