scroll-navbar and apply transform styles for hide/show states. To create a navbar that hides on scroll-down and shows on scroll-up in Webflow, you'll need to use a combination of Webflow interactions and a bit of custom JavaScript since Webflow's native interactions don’t track scroll direction directly.
scroll-navbar.
move up -100%.hide-nav.transform: none) for the visible state.
Paste the following in Page Settings > Footer Before </body>:
Without a code block, input this inline:
<script>
let lastScroll = 0;
const navbar = document.querySelector('.scroll-navbar');
window.addEventListener('scroll', () => {
const currentScroll = window.pageYOffset;
if (currentScroll > lastScroll && currentScroll > 100) {
// Scrolling down
navbar.style.transform = 'translateY(-100%)';
navbar.style.transition = 'transform 0.3s ease';
} else if (currentScroll < lastScroll) {
// Scrolling up
navbar.style.transform = 'translateY(0)';
navbar.style.transition = 'transform 0.3s ease';
}
lastScroll = currentScroll;
});
</script>
100 ensures the navbar doesn’t hide immediately at the top.
To make a Webflow navbar show on scroll-up and hide on scroll-down, use a fixed navbar, apply transform transitions, and insert a custom JavaScript snippet that detects scroll direction. This approach provides a smooth, mobile-friendly experience without relying fully on Webflow’s native interactions.