diff --git a/jquery.nav.js b/jquery.nav.js index 0f840e4..209d21a 100644 --- a/jquery.nav.js +++ b/jquery.nav.js @@ -45,7 +45,8 @@ scrollThreshold: 0.5, begin: false, end: false, - scrollChange: false + scrollChange: false, + changeClassBefore: true }, init: function() { @@ -151,8 +152,10 @@ self.config.begin(); } - //Change the highlighted nav item - self.adjustNav(self, $parent); + if(self.config.changeClassBefore) { + //Change the highlighted nav item + self.adjustNav(self, $parent); + } //Removing the auto-adjust on scroll self.unbindInterval(); @@ -169,6 +172,11 @@ if(self.config.changeHash) { window.location.hash = newLoc; } + + if(!self.config.changeClassBefore) { + //Change the highlighted nav item + self.adjustNav(self, $parent); + } //Add the auto-adjust on scroll back in self.bindInterval(); @@ -220,4 +228,4 @@ }); }; -})( jQuery, window , document ); \ No newline at end of file +})( jQuery, window , document );