Jump to content

hidden header logo that appears when scrolling

Recommended Posts

Site URL: https://bat-primrose-64j6.squarespace.com/config/

Hi,

I wonder if anyone can help with a bit of code?

I want the header logo to be invisible when you land on the page and only appear once you scroll down the page.

There's a large hero logo on the first page so I don't want two logos on the screen at the same time. I've set the header to be fixed so that's sorted, it's just getting the code so the logo is invisible and then appears.

Thanks in advance

Jordan

Link to comment

Add to Home > Design > Custom CSS

.header-title-logo img {
    visibility: hidden;
}
.shrink .header-title-logo img {
    visibility: visible;
}

 

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
  • 6 months later...
  • 2 weeks later...
On 3/13/2021 at 2:39 AM, CritiquesOverCoffee said:

Hey @tuanphan,
Thanks so much - this worked great for me too!
Is it possible to do this so the logo fades/slides in gradually?

Hi. Can you share link to your site? WE can check easier

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
  • 2 years later...
On 4/19/2023 at 2:06 PM, daviesbrand said:

@tuanphan Thanks for the above – super helpful. Would you be able to help me get the logo to appear after a certain point on the page? I'd like it to appear once off the first section.

harp-oriole-9bt6.squarespace.com
pw: hoddlestreet

Thanks!

You mean logo will disappear when users scroll to section 2?

 

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
  • 2 weeks later...

Try adding to Last Line in Code Injection > Footer

<script>
  $(window).scroll(function(){
  var scroll = $(window).scrollTop();
  if(scroll > 900){
    $('header#header').addClass('scrollNav');
  }
  else{
    $('header#header').removeClass('scrollNav');
  }
});
</script>
<style>
  header#header img {
    opacity: 0;
    transition: all 0.3s;
}
.scrollNav img {
    opacity: 1 !important;
    transition: all 0.3s;
}
</style>

 

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.