Guest Posted December 24, 2019 Posted December 24, 2019 Hi all, I want to have a different logo on my header ones you scroll down. This is the case; The background of my website is dark, but if you scroll down, a white header appears. But because the background of the logo changes from dark to white, the logo is not nice on one of these backgrounds. Because of this I have created another logo and I want to add this in a way that if I scroll down, the logo also changes to the other logo with another logo. Basically; If I scroll down I want to see the alternate logo on my header. [See attachment] [I don't know if this is relevant] But, I have created the white moving header by using custom CSS
Guest Posted December 24, 2019 Posted December 24, 2019 (edited) I am still building my website, but to get the best help; My website is open now at www.luz.software Edited December 24, 2019 by eduardvanpagee adding website link
tuanphan Posted December 24, 2019 Posted December 24, 2019 Try adding to Page Header <script> $(".scrollNav img").attr("src", "https://beaverhero.com/wp-content/uploads/2019/06/trees-3464777_640-min.jpg") </script> 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!)
Guest Posted January 4, 2020 Posted January 4, 2020 On 12/24/2019 at 5:13 PM, tuanphan said: Try adding to Page Header <script> $(".scrollNav img").attr("src", "https://beaverhero.com/wp-content/uploads/2019/06/trees-3464777_640-min.jpg") </script> Thanks for your reply @tuanphan. I have added this code to the code injection but it does not work. The logo on the nav.bar is not changing if you scroll down. Do you have any idea what I could do?
tuanphan Posted January 5, 2020 Posted January 5, 2020 14 hours ago, eduardvanpagee said: Thanks for your reply @tuanphan. I have added this code to the code injection but it does not work. The logo on the nav.bar is not changing if you scroll down. Do you have any idea what I could do? Try inserting to Footer 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!)
Guest Posted January 5, 2020 Posted January 5, 2020 Thanks for your quick reply. I have inserted the code in the footer, but still nothing happens @tuanphan
Solution tuanphan Posted January 5, 2020 Solution Posted January 5, 2020 3 minutes ago, eduardvanpagee said: Thanks for your quick reply. I have inserted the code in the footer, but still nothing happens @tuanphan Remove the code and add this to Home > Design > Custom CSS .scrollNav .Header-branding img { visibility: hidden; } .scrollNav .Header-branding { background-image: url(https://beaverhero.com/wp-content/uploads/2019/06/trees-3464777_640-min.jpg); background-size: contain; background-repeat: no-repeat; background-position: center center; } 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!)
Guest Posted January 5, 2020 Posted January 5, 2020 @tuanphan Cool! It worked man! Thanks a lot!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
savannahadcock Posted June 13, 2020 Posted June 13, 2020 Did something happen between the last two comments? I am trying to do the same thing and it didn't work when I inserted into the CSS or the header. Just wondering if I am missing a piece! Thanks.
tuanphan Posted June 13, 2020 Posted June 13, 2020 3 hours ago, savannahadcock said: Did something happen between the last two comments? I am trying to do the same thing and it didn't work when I inserted into the CSS or the header. Just wondering if I am missing a piece! Thanks. If your share link to your site & which code did you use (CSS or script code). We can check easier. 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!)
GabrielaS Posted June 21, 2020 Posted June 21, 2020 @tuanphan you're a damn star, I'm always lurking on this forum and you're generally always the one that already has the answers to all my questions! I've inserted the following code on header, tried footer also but neither worked: <script> $(window).scroll(function(){ var scroll = $(window).scrollTop(); if(scroll > 50){ $('.Header').addClass('scrollNav'); } else{ $('.Header').removeClass('scrollNav'); } }); </script> <script> $(".scrollNav img").attr("src", "https://static1.squarespace.com/static/5edb818c253cf824ff6e4ba8/t/5eef3ffb404c9c25fb6cb6c2/1592737787893/favicon-grey.png")</script> Could you help? Website link is www.gabrielasilveira.squarespace.com and password is hello. Thank you!
tuanphan Posted June 22, 2020 Posted June 22, 2020 On 6/21/2020 at 6:24 PM, GabrielaS said: @tuanphan you're a damn star, I'm always lurking on this forum and you're generally always the one that already has the answers to all my questions! I've inserted the following code on header, tried footer also but neither worked: <script> $(window).scroll(function(){ var scroll = $(window).scrollTop(); if(scroll > 50){ $('.Header').addClass('scrollNav'); } else{ $('.Header').removeClass('scrollNav'); } }); </script> <script> $(".scrollNav img").attr("src", "https://static1.squarespace.com/static/5edb818c253cf824ff6e4ba8/t/5eef3ffb404c9c25fb6cb6c2/1592737787893/favicon-grey.png")</script> Could you help? Website link is www.gabrielasilveira.squarespace.com and password is hello. Thank you! Remove above, add this to Code Injection Footer <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.0/jquery.min.js"></script> <script> $(document).ready(function() { $('.header-title-logo img').attr('src','https://beaverhero.com/wp-content/uploads/2020/05/ss-pricing-table01-min.png'); }); </script> replace with your image url 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!)
GabrielaS Posted June 22, 2020 Posted June 22, 2020 6 hours ago, tuanphan said: Remove above, add this to Code Injection Footer <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.0/jquery.min.js"></script> <script> $(document).ready(function() { $('.header-title-logo img').attr('src','https://beaverhero.com/wp-content/uploads/2020/05/ss-pricing-table01-min.png'); }); </script> replace with your image url Thank you for getting back to me, I've replaced the code with the above but now it just makes the logo always show as the 'alternative' logo (the one I want to change to after scrolling down)
tuanphan Posted June 23, 2020 Posted June 23, 2020 ah forgot class, try again with this <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.0/jquery.min.js"></script> <script> $(document).ready(function() { $('.shrink .header-title-logo img').attr('src','https://beaverhero.com/wp-content/uploads/2020/05/ss-pricing-table01-min.png'); }); </script> 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!)
GabrielaS Posted June 23, 2020 Posted June 23, 2020 42 minutes ago, tuanphan said: ah forgot class, try again with this <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.0/jquery.min.js"></script> <script> $(document).ready(function() { $('.shrink .header-title-logo img').attr('src','https://beaverhero.com/wp-content/uploads/2020/05/ss-pricing-table01-min.png'); }); </script> This one isn't doing anything that I can see I'm afraid 😞 (tried both header and footer injection)
lieslmaduro Posted June 23, 2020 Posted June 23, 2020 Any luck @GabrielaS? I am having the exact same issue!
RyanDejaegher Posted June 23, 2020 Posted June 23, 2020 @lieslmaduro do you have a link to the site? I can help you out Philadelphia, PA 👉 Squarespace Tutorials Chat/Message on FB Messenger for quickest response: https://m.me/dejaegherryan
samasplen Posted July 9, 2020 Posted July 9, 2020 hi @GabrielaS @RyanDejaegher @tuanphananh luck?? I'm trying to do the same but with Squarespace 7.1? Any answer/fix would be hugely appreciated! My in progress site: https://endive-swordfish-kjf7.squarespace.com password: temppassword2020
rwp Posted July 9, 2020 Posted July 9, 2020 1 hour ago, samasplen said: hi @GabrielaS @RyanDejaegher @tuanphananh luck?? I'm trying to do the same but with Squarespace 7.1? Any answer/fix would be hugely appreciated! My in progress site: https://endive-swordfish-kjf7.squarespace.com password: temppassword2020 We got that working for @GabrielaS, might work for your page as well.
tommywhitty Posted December 16, 2020 Posted December 16, 2020 This is the solution I found after 2 days of trying the above (the bit i used is in part 2) Give the guy a follow on youtube. tuanphan 1
MariaFY Posted May 10, 2021 Posted May 10, 2021 @tuanphan, I could use your help with something similar. Trying to invert logo & header nav on scroll in SS 7.1. Goal is to display the logo, nav and social icons in white and have the turn black on scroll (once you see the white background). site: https://bison-marigold-6s6h.squarespace.com pw: haiku
tuanphan Posted May 12, 2021 Posted May 12, 2021 On 5/11/2021 at 3:35 AM, MariaFY said: @tuanphan, I could use your help with something similar. Trying to invert logo & header nav on scroll in SS 7.1. Goal is to display the logo, nav and social icons in white and have the turn black on scroll (once you see the white background). site: https://bison-marigold-6s6h.squarespace.com pw: haiku Add to Design > Custom CSS /* on scroll header */ header#header.shrink { background: black !important; } header#header.shrink img { filter: brightness(0) invert(1); } header#header.shrink .header-nav-list * { color: white; } header#header.shrink .header-actions * { fill: white; stroke: white; } MariaFY 1 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!)
MariaFY Posted May 12, 2021 Posted May 12, 2021 Thanks a million @tuanphan. You're killing it every single time!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment