Skip to content
Advertisement

Hide nav bar on scroll down and show it on scroll up

I’m using this wordpress theme http://newnotio.fuelthemes.net/space/ and I’d like the nav bar to be hidden on scroll down and to be visible on scroll up (instead of always visible).

Can you help me to achieve this?

Edit 15/07: I’ve managed to add a class to the header php script of the theme. I’ve called it nav-down as I’m trying to replicate this: http://jsfiddle.net/mariusc23/s6mLJ/31/

I’ve also copy/pasted the JS code but I’m getting an error message that “$ is not a function”. Any idea what the issue is? Thanks

enter image description here

JavaScript
JavaScript

Advertisement

Answer

You can achieve this without adding a class to your header, using plain javascript. Here is an example:

JavaScript
JavaScript
JavaScript

Edit: here is an updated snippet that should work for the website in question.

JavaScript
JavaScript
JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement