Jump to content

Create a transparent header that appears when user scrolls?

Recommended Posts

  • Replies 4
  • Views 231
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

@SanHolo First enable the ‘Fixed Position’ option for your header in the Squarespace editor by navigating to Edit > Edit Site Header > Edit Design > Fixed Position, and toggle it on. See the screenshot for reference.

After that, you can add this code under Website > Pages > Website Tools > Custom CSS. Code hides the header initially, making it visible once you start scrolling.

.header {
  opacity: 0;
 transition: opacity 1.3s ease-in-out;
}

.header.shrink {
  opacity: 1;
}

FixedHeader.png

Edited by Lesum

If my comments were useful, please like or mark my solution as answer so others can scroll to it quickly. 

Sam
Web Developer & Digital Designer

 Did you find my contribution helpful? Buy me a coffee?

Link to comment
Posted (edited)

Worked like a charm! Thank you so much.

I'm wondering, is there a way to make it fade in so that its appearance isn't so abrupt?

I notice that there's a transition line in the code you provided but that part didn't work for whatever reason.

Edited by SanHolo
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.