Skip to content

Commit

Permalink
refine script
Browse files Browse the repository at this point in the history
  • Loading branch information
silverailscolo committed Nov 3, 2019
1 parent badebf6 commit a6785f8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions web/js/here.js
@@ -1,14 +1,15 @@
/*
Highlight the li element with href link to the current page in the left sidebar
Since 11 2019
Since Nov 2019
*/

document.documentElement.className="hasJS";

$(function(){
var $page = window.location.href;
$('a').each(function() {
if ($(this).prop('href') == window.location.href) {
if ($(this).prop('href') == $page) {
$(this.parentNode).addClass('here');
}
});
})
});

0 comments on commit a6785f8

Please sign in to comment.