Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions jquery.stickyNavbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@
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
hide: 'itemHide' //Class that will only display item when scroll is activated
}, prop),
sections = $('.' + options.sectionSelector);

Expand Down Expand Up @@ -86,7 +88,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
Expand Down Expand Up @@ -146,7 +150,8 @@
}
}
});

// hide any items with hide class
$('.'+options.hide).hide();
/* 1.) As soon as we start scrolling */
if (windowPosition >= $selfScrollTop + options.startAt) {

Expand All @@ -158,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) {
Expand Down