From 7e9b5e4477f22e4730dee46f2cf83735130daf7e Mon Sep 17 00:00:00 2001 From: snollygolly Date: Wed, 13 Apr 2016 21:40:43 -0500 Subject: [PATCH] added active link to li in side-nav #24 --- _layouts/default.html | 4 ++-- javascripts/custom/active-link.js | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/_layouts/default.html b/_layouts/default.html index f23e169..bf40325 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -119,7 +119,7 @@

3. blinky
  • - 4. modules + 4. modules +
  • 5. tweet diff --git a/javascripts/custom/active-link.js b/javascripts/custom/active-link.js index d29cef0..72cdce1 100644 --- a/javascripts/custom/active-link.js +++ b/javascripts/custom/active-link.js @@ -1,4 +1,6 @@ $(document).ready(function () { if (location.pathname != "/modules") - $("a[href*='" + location.pathname + "']").addClass("currentlink"); + var navLink = "a[href*='" + location.pathname + "']"; + $(navLink).addClass("currentlink"); + $(navLink).parent("li").addClass("active"); });