diff --git a/README.md b/README.md index ba524c6..ed6c4e9 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![build status](https://secure.travis-ci.org/jimmynotjim/scrollNav.png?branch=v2.3.0)](http://travis-ci.org/jimmynotjim/scrollNav.js) +[![build status](https://secure.travis-ci.org/jimmynotjim/scrollNav.png?branch=v2.3.1)](http://travis-ci.org/jimmynotjim/scrollNav.js) # [jQuery scrollNav][1] @@ -213,7 +213,7 @@ scrollNav is Copyright © 2012-2013 James Wilson, released under the [MIT li ## Version -Latest stable version is v2.3.0. Make sure to view [the changelog][15] before updating, v2 is a complete re-write of the plugin. +Latest stable version is v2.3.1. Make sure to view [the changelog][15] before updating, v2 is a complete re-write of the plugin. ## Testing diff --git a/bower.json b/bower.json index bcb144b..abfb3ed 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "scrollNav", - "version": "2.3.0", + "version": "2.3.1", "author": { "name": "James Wilson", "email": "jimmynotjim@me.com", diff --git a/dist/jquery.scrollNav.js b/dist/jquery.scrollNav.js index 9bb2022..080247f 100644 --- a/dist/jquery.scrollNav.js +++ b/dist/jquery.scrollNav.js @@ -1,4 +1,4 @@ -/*! scrollNav - v2.3.0 - 2014-10-09 +/*! scrollNav - v2.3.1 - 2014-10-30 * http://scrollnav.com * Copyright (c) 2014 James Wilson; Licensed MIT */ (function($) { @@ -205,7 +205,7 @@ else { $nav.removeClass('fixed'); } $.each(S.sections.data, function() { - if ( (this.top_offset > boundry_top && this.top_offset < boundry_bottom) || (this.bottom_offset > boundry_top && this.bottom_offset < boundry_bottom) || (this.top_offset < boundry_top && this.bottom_offset > boundry_bottom) ) { + if ( (this.top_offset >= boundry_top && this.top_offset <= boundry_bottom) || (this.bottom_offset > boundry_top && this.bottom_offset < boundry_bottom) || (this.top_offset < boundry_top && this.bottom_offset > boundry_bottom) ) { sections_active.push(this); } }); diff --git a/dist/jquery.scrollNav.min.js b/dist/jquery.scrollNav.min.js index 8cde05f..a6ec9e0 100644 --- a/dist/jquery.scrollNav.min.js +++ b/dist/jquery.scrollNav.min.js @@ -1,4 +1,4 @@ -/*! scrollNav - v2.3.0 - 2014-10-09 +/*! scrollNav - v2.3.1 - 2014-10-30 * http://scrollnav.com * Copyright (c) 2014 James Wilson; Licensed MIT */ -!function(a){var b=function(b,c,d,e){if(a(b).length>0){var f=a(b).offset().top;c=e?c:0,a("html:not(:animated),body:not(:animated)").animate({scrollTop:f-d},c)}},c=function(){return window.location.hash},d={classes:{loading:"sn-loading",failed:"sn-failed",success:"sn-active"},defaults:{sections:"h2",subSections:!1,sectionElem:"section",className:"scroll-nav",showHeadline:!0,headlineText:"Scroll To",showTopLink:!0,topLinkText:"Top",fixedMargin:40,scrollOffset:40,animated:!0,speed:500,insertLocation:"insertBefore",arrowKeys:!1,onInit:null,onRender:null,onDestroy:null},_set_body_class:function(b){var c=a("body");"loading"===b?c.addClass(d.classes.loading):c.removeClass(d.classes.loading).addClass("success"===b?d.classes.success:d.classes.failed)},_find_sections:function(b){var c=d.settings.sections,e=[];if(d.settings.showTopLink){var f=b.children().first();f.is(c)||e.push(f.nextUntil(c).andSelf())}b.find(c).each(function(){e.push(a(this).nextUntil(c).andSelf())}),d.sections={raw:e}},_setup_sections:function(b){var c=[];a(b).each(function(b){var e=[],f=a(this),g="scrollNav-"+(b+1),h=function(){return 0===b},i=function(){return!f.eq(0).is(d.settings.sections)},j=d.settings.showTopLink&&h()&&i()?d.settings.topLinkText:f.filter(d.settings.sections).text();if(f.wrapAll("<"+d.settings.sectionElem+' id="'+g+'" class="'+d.settings.className+'__section" />'),d.settings.subSections){var k=f.filter(d.settings.subSections);k.length>0&&k.each(function(b){var c=g+"-"+(b+1),h=a(this).text(),i=f.filter(a(this).nextUntil(k).andSelf());i.wrapAll('
'),e.push({id:c,text:h})})}c.push({id:g,text:j,sub_sections:e})}),d.sections.data=c},_tear_down_sections:function(b){a(b).each(function(){var b=this.sub_sections;a("#"+this.id).children().unwrap(),b.length>0&&a(b).each(function(){a("#"+this.id).children().unwrap()})})},_setup_nav:function(b){var c=a("",{"class":d.settings.className+"__heading",text:d.settings.headlineText}),e=a("
",{"class":d.settings.className+"__wrapper"}),f=a("