Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/miguelsimoni/hugo-initio.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/static
diff options
context:
space:
mode:
authorMiguel Simoni <miguel.simoni@gmail.com>2018-10-22 18:10:35 +0300
committerGitHub <noreply@github.com>2018-10-22 18:10:35 +0300
commit7b62642cbf14d367e91e2250afe309932b4f6dbc (patch)
treed02b655ca94f427536a0dbc6a154e81e0946b68f /static
parentd2c8891b0b92c69977354dd00751b3fb10f89d87 (diff)
parentd25de4e4229f6c9b62a55a135907152bc9671a0e (diff)
Merge pull request #17 from koi-science/master
Fix jumpy navbar
Diffstat (limited to 'static')
-rw-r--r--static/js/template.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/static/js/template.js b/static/js/template.js
index 5d2c94f..2267958 100644
--- a/static/js/template.js
+++ b/static/js/template.js
@@ -1,6 +1,7 @@
jQuery(document).ready(function($) {
var my_nav = $('.navbar-sticky');
+ var fake_nav = $('.navbar-fake');
// grab the initial top offset of the navigation
var sticky_navigation_offset_top = my_nav.offset().top;
@@ -10,10 +11,13 @@ jQuery(document).ready(function($) {
// if we've scrolled more than the navigation, change its position to fixed to stick to top, otherwise change it back to relative
if (scroll_top > sticky_navigation_offset_top) {
+ fake_nav.height(my_nav.outerHeight());
+ fake_nav.show();
my_nav.addClass( 'stick' );
} else {
my_nav.removeClass( 'stick' );
- }
+ fake_nav.hide();
+ }
};
var initio_parallax_animation = function() {
@@ -35,4 +39,4 @@ jQuery(document).ready(function($) {
initio_parallax_animation();
});
-}); \ No newline at end of file
+});