Initial commit.
This commit is contained in:
18
js/navbar.js
Normal file
18
js/navbar.js
Normal file
@ -0,0 +1,18 @@
|
||||
(function()
|
||||
{
|
||||
// Highlight the current page in the navbar
|
||||
var highlightLink = function()
|
||||
{
|
||||
var links = document.getElementsByClassName("sidelink");
|
||||
for (var i = 0; i < links.length; i++) {
|
||||
if (links[i].href == location)
|
||||
links[i].className += " sidelink-active";
|
||||
}
|
||||
}
|
||||
|
||||
// Attach onload handler
|
||||
if (window.addEventListener)
|
||||
window.addEventListener("load", highlightLink, false);
|
||||
else if (window.attachEvent)
|
||||
window.attachEvent("onload", highlightLink);
|
||||
})();
|
Reference in New Issue
Block a user