Jump to content

Five: Keep header and navigation bar visible when scrolling?

Recommended Posts

Currently when I scroll down my website, my header image and navigation bar go away, which is annoying because I don’t want visitors to have to scroll all the way up to go to a different section of the website. I’d like my content to flow underneath a static header and navigation bar.

Any suggestions would be appreciated.

james-leslie-xq0u.squarespace.com

Link to comment
  • Replies 18
  • Views 40.9k
  • Created
  • Last Reply

Okay paste this in Custom CSS:


body.top-navigation-position-below-banner #navigation-bottom {
  position: fixed; 
  top: 0;
  border-bottom: none;
  z-index: 999;
} 

#page-header-wrapper { margin-top: 180px; }

Now for mobile fix:


@media screen and (max-width: 640px) {
  #page-header-wrapper { margin-top: 0 !important; }
} 

Squarespace developer since 2007.

I create a professional process for each client to ensure that your objectives are met and users are happy. Something I love to embrace.

I'm available for hire

Get in touch at http://www.nickscola.com or via email at squaretuts@gmail.com
Link to comment

Well, first of all I want to thank you so much. I'm having a bit of an issue, however. It looks like my nav bar has gone above my header using this code and it bleeds into my posts when I scroll down. I haven't saved.

Is it possible to keep the header and nav bar's position fixed (like it is now) and have the content flow underneath -- so matter how far you scroll down the header and nav bar are always above the canvas and sidebars?

I can't tell you how much I appreciate your help.

Link to comment

Oops I forgot to apply this code as well: z-index: 999; I've just updated the code.

The Hero image is the banner image. Your header is the navigation + sit logo.

Squarespace developer since 2007.

I create a professional process for each client to ensure that your objectives are met and users are happy. Something I love to embrace.

I'm available for hire

Get in touch at http://www.nickscola.com or via email at squaretuts@gmail.com
Link to comment

Hey! You're almost there and you're awesome for helping me out. Haven't saved the code. That code puts the navigation bar above the header image, though. Are you able to update the code to keep the navigation bar below header image like it was before. If you can't, your code will work for me!

Link to comment
  • 2 weeks later...

@pixxbee thanks. Now what do you want to be fixed? Navigation? The logo + navigation? etc. I have an example on my site: http://www.nickscola.com scroll down and you'll see.

Squarespace developer since 2007.

I create a professional process for each client to ensure that your objectives are met and users are happy. Something I love to embrace.

I'm available for hire

Get in touch at http://www.nickscola.com or via email at squaretuts@gmail.com
Link to comment

i basically want my social media buttons directly under the navigation links (blog, about us, contributers etc) and above the first blog post.

Exp


                                   PIXXBEE

-------------blog--about us--contributers-get you site on pixxbee------------------

Twitter button / facebook button

first blog post.second blog post etc..

the problem is when on the mobile version there are no social media icons untill you scroll past all the blogs since my desktop version has 2 columns. Mobile version shows the blogs as column 1 and social media as column 2.

Link to comment

Okay for those buttons on the top left it will require some jQuery. Here's what I have in my code injection - header. Very simple. Now you just need to customize it a TAD to make the buttons be inline instead of a block:

http://pastebin.com/Fqai2sPP

A lot of ways to go about this with jQuery. I just went with one of the methods.

Squarespace developer since 2007.

I create a professional process for each client to ensure that your objectives are met and users are happy. Something I love to embrace.

I'm available for hire

Get in touch at http://www.nickscola.com or via email at squaretuts@gmail.com
Link to comment
  • 2 months later...

Nick!

I'm trying to do this as well on the Five template at www.thealmanacmag.com. The code fixes the navigation but places it above the header.

Is it possible to keep the header and nav bar's position fixed (as it is now) and have the content flow underneath -- so the header and navigation bar are always above the canvas and sidebars?

Thanks so much for sharing your amazing skills!

M

Link to comment
  • 1 year later...
  • 5 months later...

Thanks Nick

I'm also working with Five - it didn't work as first then I changes a couple of things and its working a treat!

I'm only a novice but here's what I came up with -

body.top-navigation-position-above-banner #navigation-top {position: fixed; top: 0; border-bottom: none; z-index: 999;} #page-header-wrapper { margin-top: 10px; }

http://theyogaclass.com.au

Ti

Link to comment
  • 6 months later...
  • 4 years later...
On 7/30/2015 at 7:38 AM, Tiean said:

 

I'm only a novice but here's what I came up with -

body.top-navigation-position-above-banner #navigation-top {position: fixed; top: 0; border-bottom: none; z-index: 999;} #page-header-wrapper { margin-top: 10px; }

http://theyogaclass.com.au

Ti

This worked wonderfully! All I had to do was change the 10px at the end until it didn't cover the banner. Thanks so much!

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.