From 081c0810f3631a45d5dcb69da6823063d1f53354 Mon Sep 17 00:00:00 2001 From: Jason Utt Date: Wed, 7 Oct 2015 13:46:20 -0400 Subject: [PATCH 1/2] Update jquery.stickyNavbar.js Give the user the ability to use anchor links or the ability to use regular absolute/relative links. --- jquery.stickyNavbar.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/jquery.stickyNavbar.js b/jquery.stickyNavbar.js index 61665d1..1fa33a7 100644 --- a/jquery.stickyNavbar.js +++ b/jquery.stickyNavbar.js @@ -43,7 +43,8 @@ mobileWidth: 480, // The viewport width (without scrollbar) under which stickyNavbar will not be applied (due user usability on mobile) zindex: 9999, // The zindex value to apply to the element: default 9999, other option is 'auto' stickyModeClass: 'sticky', // Class that will be applied to 'this' in sticky mode - unstickyModeClass: 'unsticky' // Class that will be applied to 'this' in non-sticky mode + unstickyModeClass: 'unsticky', // Class that will be applied to 'this' in non-sticky mode + anchorLinks: true //Set to false if not using anchor links }, prop), sections = $('.' + options.sectionSelector); @@ -86,7 +87,9 @@ } // prevent default click behaviour - e.preventDefault(); + if(options.anchorLinks == true) { + e.preventDefault(); + } // href attr of clicked nav link currentHref = href.substr(1); // remove # character with substr From da9ab2aba8c814900e41366ed527ffccb272cc98 Mon Sep 17 00:00:00 2001 From: Jason Utt Date: Wed, 7 Oct 2015 14:11:31 -0400 Subject: [PATCH 2/2] Update jquery.stickyNavbar.js Added hide ability when scroll nav is not activated. --- jquery.stickyNavbar.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/jquery.stickyNavbar.js b/jquery.stickyNavbar.js index 1fa33a7..c908551 100644 --- a/jquery.stickyNavbar.js +++ b/jquery.stickyNavbar.js @@ -44,7 +44,8 @@ zindex: 9999, // The zindex value to apply to the element: default 9999, other option is 'auto' stickyModeClass: 'sticky', // Class that will be applied to 'this' in sticky mode unstickyModeClass: 'unsticky', // Class that will be applied to 'this' in non-sticky mode - anchorLinks: true //Set to false if not using anchor links + anchorLinks: true, //Set to false if not using anchor links + hide: 'itemHide' //Class that will only display item when scroll is activated }, prop), sections = $('.' + options.sectionSelector); @@ -149,7 +150,8 @@ } } }); - + // hide any items with hide class + $('.'+options.hide).hide(); /* 1.) As soon as we start scrolling */ if (windowPosition >= $selfScrollTop + options.startAt) { @@ -161,7 +163,8 @@ 'position': 'fixed', 'zIndex': options.zindex }).stop(); - + //look for element that has the hidden element + $('.'+options.hide).show(); // if jQuery effects are turned on if (options.jqueryEffects) { if (!options.animateCSSRepeat) {