Skip to content

Commit

Permalink
added active link to li in side-nav
Browse files Browse the repository at this point in the history
  • Loading branch information
snollygolly committed Apr 14, 2016
1 parent c3625ed commit 7e9b5e4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ <h1><a href="https://tessel.io/"><nobr><img src=
<a href="{{ site.baseurl }}/blinky.html">3. blinky</a>
</li>
<li>
<a href="{{ site.baseurl }}/modules.html">4. modules<!--ul-->
<a href="{{ site.baseurl }}/modules.html">4. modules</a><!--ul-->
<ul>
<li style="padding-left:10px;">
<a href="{{ site.baseurl }}/modules/accelerometer.html" class=
Expand Down Expand Up @@ -167,7 +167,7 @@ <h1><a href="https://tessel.io/"><nobr><img src=
<a href="{{ site.baseurl }}/modules/storage.html" class=
"side-bar-modules">storage</a>
</li>
</ul></a>
</ul>
</li>
<li>
<a href="{{ site.baseurl }}/tweet.html">5. tweet</a>
Expand Down
4 changes: 3 additions & 1 deletion javascripts/custom/active-link.js
Original file line number Diff line number Diff line change
@@ -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");
});

0 comments on commit 7e9b5e4

Please sign in to comment.