t-bone
t-bone

Reputation: 184

FullPage.js: Only show navigation when scrolling

I'm making a website with fullPage.js and for design purposes I want the navigation only to show when scrolling. I've tried this

$(document).ready(function() {
            $('#fullpage').fullpage({
                //navigation
                menu: '#menu',             
                navigation: window.addEventListener("scroll", function(){return true}),
                navigationPosition: 'right',
                scrollBar: true,
            }); 
        });

but it doesn't work.

Upvotes: 0

Views: 519

Answers (1)

t-bone
t-bone

Reputation: 184

Based on help from @gcampbell this worked for me

var nav = document.querySelector('#fp-nav'); 
        nav.style.display = 'none'; 
        document.addEventListener('scroll', function () { 
            nav.style.display = 'inline';
            setTimeout(function(){ nav.style.display = 'none'}, 1000); 
        });
    });

Upvotes: 1

Related Questions