Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #28 from seutje/patch-1

Tolerance causes the highlighting of nav elements to seem inaccurate
  • Loading branch information...
commit f7c0cfd4450247e33941d8b91b9aa480074927c5 2 parents dd94613 + e826324
@paulirish paulirish authored
Showing with 2 additions and 4 deletions.
  1. +2 −4 js/init.js
View
6 js/init.js
@@ -143,13 +143,11 @@
timeout = false, // so gonna clear this later, you have NO idea
last = false, // makes sure the previous link gets un-activated
check = function() {
- var scroll = $scrollable.scrollTop(),
- height = $body.height(),
- tolerance = $window.height() * ( scroll / height );
+ var scroll = $scrollable.scrollTop();
$.each( cache, function( i, v ) {
// if we're past the link's section, activate it
- if ( scroll + tolerance > v.target.position().top ) {
+ if ( scroll + $navheight > v.target.position().top ) {
last && last.removeClass('active');
last = v.link.addClass('active');
} else {
Please sign in to comment.
Something went wrong with that request. Please try again.