Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search
  • 0
pflombard

7.1 - Fixed header on only one page.

Question

Hey everyone!

In 7.1, how would you set the header to a "Fixed position", on only one specific page? 

I.e., on all other pages it should disappear when you start to scroll.

I've searched high and low and it appears that no one has addressed this issue yet.

Any help would be greatly appreciated!

Pierre

Share this post


Link to post

9 answers to this question

Recommended Posts

  • 1

If you share your page I can get the actual code, but it will be something like

#collection #header {
  position: fixed;
}

 


Free Squarespace 7.1 Anchor Link and Accordion Plugins available here!

If I replied to one of your questions with code, it was either CSS or jQuery.

To add CSS, go to Design -> Custom CSS

jQuery needs some additional steps. Head here: https://code.jquery.com/ and click on minified, under jQuery 3.x and copy that code into Squarespace.

After you put that code into the code injection section in Squarespace, you can add the code I supplied. The code from me will need <script> added before it and </script> added after it (only for jQuery).

There are two places that you can add the code, one is site wide (adds to all pages). Settings -> Advanced -> Code Injection

The other is for a specific page (adds to one page only). Pages -> Gear Icon next to the page -> Advanced

Share this post


Link to post
  • 1

Hi @Jimi
Yes, You can get this details via Inspect Element of your browser. Then target the body tag.
You see ID and so huge! Class list there. Btw classes you can find collection also quick way is the ID of Body.

Please use the like button if it helps you!

Best,
Leopold


Ninja Kit Extension: Upgrade your Squarespace website without coding.

YouTube Preview    -    FREE DOWNLOAD

Share this post


Link to post
  • 0
48 minutes ago, rwp said:

 


#collection #header {
  position: fixed;
}

 

Thanks so much rwp! This put me on the right path.

I found the collection-id for that specific page. 

This is the end result that worked just great.

#collection-5ef47e01a0680c5b1a28ecac #header {
  position: fixed !important;
  z-index: 1000;   //in case it scrolls behind certain elements further down.
  background: #df4430;  //because header was transparent.
}

 

Share this post


Link to post
  • 0

How can I find out the collection-id?

like the one you wrote: 

#collection-5ef47e01a0680c5b1a28ecac

Thank you!

Share this post


Link to post
  • 0
Posted (edited)

Hi Leopold

Thank you for your reply!

How do I get to that info?

Using my browsers "Inspect" ? 

Edited by Jimi

Share this post


Link to post
  • 0

I am putting that into my page header code injection but nothing happens...

 

just this

 

 

Screenshot 2020-08-27 at 21.43.20.jpg

Share this post


Link to post
  • 0
19 hours ago, Jimi said:

I am putting that into my page header code injection but nothing happens...

 

just this

 

 

Wrap code in style tag, add this to Page Header

<style>
  #header {
  position: fixed !important;
  z-index: 1000;   
  background: #df4430; 
}
</style>

 


You can send your question to my email to get faster answer. / How to Setup Password & Share URL 

-- I'm Tuan. I work for a non-profit project (build free libraries). I check the forum once or twice a day to help out the community. If you don't see me answering your question, you can send it to the email above. There are so many questions every day so I can't answer them all at once, I will try to answer them in the next few days.

Share this post


Link to post

Create an account or sign in to comment

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


×
×
  • Create New...