From 3ef02e187cf6bc75fd6fa43699e21e6aed40ca9f Mon Sep 17 00:00:00 2001 From: Ante Primorac Date: Sat, 24 Aug 2013 10:41:24 +0200 Subject: [PATCH] Update jquery.nav.js Fix of a bug when the first section isn't on the first position in navigation. --- jquery.nav.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jquery.nav.js b/jquery.nav.js index abc74ba..ff596b0 100644 --- a/jquery.nav.js +++ b/jquery.nav.js @@ -131,7 +131,7 @@ var windowHeight = Math.round(this.$win.height() * this.config.scrollThreshold); for(var section in this.sections) { - if((this.sections[section] - windowHeight) < windowPos) { + if((this.sections[section] - windowHeight) < windowPos && (returnValue == null || this.sections[section] > this.sections[returnValue])) { returnValue = section; } } @@ -220,4 +220,4 @@ }); }; -})( jQuery, window , document ); \ No newline at end of file +})( jQuery, window , document );