Skip to content

Commit

Permalink
Fixed #9 - Only remove active classes within the toc element
Browse files Browse the repository at this point in the history
  • Loading branch information
gfranko committed Dec 13, 2012
1 parent c06649b commit 3fa8106
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
11 changes: 11 additions & 0 deletions demos/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,17 @@
</head>

<body>
<nav class="navbar">
<div class="navbar-inner">
<div class="container">
<ul class="nav">
<li><a href="/alatriste/1">One</a></li>
<li class="active"><a href="/alatriste/2">Two</li>
<li><a href="/alatriste/3">Three</li>
</ul>
</div>
</div>
</nav>
<a href="https://github.com/gfranko/jquery.tocify.js" target="_blank" id="fork-me"><img style="position: fixed;top: 0; right: 0; border: 0;z-index:999999;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_white_ffffff.png" alt="Fork me on GitHub" alt="Fork me on GitHub"></a>

<div class="container-fluid">
Expand Down
4 changes: 2 additions & 2 deletions src/javascripts/jquery.tocify.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@
if(hash.length) {

// Removes highlighting from all of the list item's
$("." + self.focusClass).removeClass(self.focusClass);
self.element.find("." + self.focusClass).removeClass(self.focusClass);

// Highlights the current list item that was clicked
elem.addClass(self.focusClass);
Expand All @@ -235,7 +235,7 @@
else {

// Removes highlighting from all of the list item's
$("." + self.focusClass).removeClass(self.focusClass);
self.element.find("." + self.focusClass).removeClass(self.focusClass);

}

Expand Down
4 changes: 2 additions & 2 deletions src/javascripts/jquery.tocify.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3fa8106

Please sign in to comment.