SouthernSunEvents Posted August 3, 2021 Share Posted August 3, 2021 (edited) This is what I've been searching months for! I'm curious if I can I prevent the menu nav from appearing until they are back up at the top of the page? http://www.southernsunevents.com PW: sse2020 Edited August 3, 2021 by SouthernSunEvents Link to comment
lina1570047784 Posted March 31, 2023 Share Posted March 31, 2023 On 1/1/2021 at 5:51 AM, Beyondspace said: Add this to Settings->Advanced->Code Injection->Footer <style> header.Header, .Mobile-bar { transition: transform 0.4s; } .scroll-down header.Header, .scroll-down .Mobile-bar { transform: translate3d(0, -100%, 0); } </style> <script> document.addEventListener('DOMContentLoaded', function() { const body = document.body; const scrollUp = "scroll-up"; const scrollDown = "scroll-down"; let lastScroll = 0; window.addEventListener("scroll", () => { const currentScroll = window.pageYOffset; if (currentScroll <= 0) { body.classList.remove(scrollUp); return; } if (currentScroll > lastScroll && !body.classList.contains(scrollDown)) { // down body.classList.remove(scrollUp); body.classList.add(scrollDown); } else if (currentScroll < lastScroll && body.classList.contains(scrollDown)) { // up body.classList.remove(scrollDown); body.classList.add(scrollUp); } lastScroll = currentScroll; }); }); </script> Hi, this is what I've been looking for ... the header to go away when scrolling down, but reappear when scrolling up. I have Wexley 7.0 and this code doesn't work. I Do you happen to know if there is a code for this? Thanks in advance. Link to comment
tuanphan Posted April 5, 2023 Share Posted April 5, 2023 On 3/31/2023 at 6:50 PM, lina1570047784 said: Hi, this is what I've been looking for ... the header to go away when scrolling down, but reappear when scrolling up. I have Wexley 7.0 and this code doesn't work. I Do you happen to know if there is a code for this? Thanks in advance. Can you share link to your site? Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!) Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment