Jump to content

How can I shrink the site title on scroll in 7.1? (not the logo)

Recommended Posts

Hello!

Add the below code in Settings -> Advanced -> Code Injection > FOOTER

 

<script>
window.addEventListener("scroll", function() {
  var siteTitle = document.querySelector("#site-title"); 
  if(window.pageYOffset >= 30) {
    siteTitle.className = "smaller-font";
  } else {
    siteTitle.className = "";
  }
});
</script>

And the below code in Design -> Custom CSS 
 

#site-title.smaller-font {
    font-size : 23px;
}

 

Screenshot 2021-06-22 at 21.23.05.png

Link to comment
2 hours ago, sorca_marian said:

Hello!

Add the below code in Settings -> Advanced -> Code Injection > FOOTER

 


<script>
window.addEventListener("scroll", function() {
  var siteTitle = document.querySelector("#site-title"); 
  if(window.pageYOffset >= 30) {
    siteTitle.className = "smaller-font";
  } else {
    siteTitle.className = "";
  }
});
</script>

And the below code in Design -> Custom CSS 
 


#site-title.smaller-font {
    font-size : 23px;
}

 

Screenshot 2021-06-22 at 21.23.05.png

Amazing, thank you so much!

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.