SUPevent Posted November 9, 2021 Share Posted November 9, 2021 Site URL: https://www.sup-event.com/ Hey, I would like to fix the header, but make it shrink and let the logo vanish when you scroll down. Can you suggest some CSS Coding? I tried to look for answer here in the forum but I couldn't find anything that would work. Thank you an nice greetings Link to comment
tuanphan Posted November 11, 2021 Share Posted November 11, 2021 (edited) On 11/9/2021 at 10:33 PM, SUPevent said: Site URL: https://www.sup-event.com/ Hey, I would like to fix the header, but make it shrink and let the logo vanish when you scroll down. Can you suggest some CSS Coding? I tried to look for answer here in the forum but I couldn't find anything that would work. Thank you an nice greetings Add to Settings > Advanced > Code Injection > Footer <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> <script> $(function(){ var visibleTop = 30; $(window).scroll(function() { var scroll = getCurrentScroll(); if ( scroll >= visibleTop ) { $('header#header').addClass('tuan'); } else { $('header#header').removeClass('tuan'); } }); function getCurrentScroll() { return window.pageYOffset || document.documentElement.scrollTop; } }); </script> <style> header#header { position: fixed; top: 0; left: 0; width: 100%; z-index: 9999; } header#header img { transition: all 0.3s; } .tuan img { width: 50px !important; transition: all 0.3s; } </style> Edited November 11, 2021 by tuanphan missing closing tag Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message How to: Setup Password & Share url - Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care 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