Hide mobile menu, when scrolling down
-
Hey ,
I want to know if its possible to hide the mobile menu bar when you scrolling down?
I know where i can add the JS for that but i dont know the HTML class i need to address, to remove the menu bar when u scrolling down on your mobile device.
Would be great if one of u could share some ideas or maybe had the same problem before.
Thank you
best regards
Schmarcopolo
-
Dear @schmarcopolo
Could you please post a link to your website and i can take a better look :)
Sincerely
Richard -
Hi Guys,
same topic. Want to hide site titel and Navbar when scrolling on mobile (like it is on Desktop) using this script below:
But can't address the right class(?). What I doing wrong?
Link to website
https://truestedt.albrechtgaebel.de/Thx
<script> var prevScrollpos = window.pageYOffset; window.onscroll = function() { var currentScrollPos = window.pageYOffset; if (prevScrollpos > currentScrollPos) { document.getElementById("navbar").style.top = "0"; } else { document.getElementById("navbar").style.top = "-50px"; } prevScrollpos = currentScrollPos; } </script>``` -
navbar doesnt have the id navbar but the class navbar
you could just do jQuery('.navbar').css('transform', 'translateY(-100%)');
-
navbar doesnt have the id navbar but the class navbar
you could just do jQuery('.navbar').css('transform', 'translateY(-100%)');
@arminunruh
where, how, what can i enter, that the mobile-menue hides ? -
@Ludwig said in Hide mobile menu, when scrolling down:
where, how, what can i enter, that the mobile-menue hides ?
hey theres no lay theme built in way for the mobile menu to hide on scroll
i think @albrecht might have used this code to make it work not sure
<script> var prevScrollpos = window.scrollY; window.onscroll = function() { var currentScrollPos = window.scrollY; if (prevScrollpos > currentScrollPos) { document.querySelector(".navbar").style.top = "0"; } else { document.querySelector(".navbar").style.top = "-50px"; } prevScrollpos = currentScrollPos; } </script>
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login