[Tips & Scripts] Creating a Fixed Header/Footer (aka Sticky Header)



Show first post

156 replies

This isn’t working for me. The header is now fixed to the top of the page but all the buttons and text in the header have disapeared.

Here is my site: https://www.reigatedentalcntr.com/

Thanks

Thanks for this tips. Do you know how I can add the fixed header below the image header, like this : Hubspot exemple
Helene

Hey everyone! It’s not working for me and the jQuery checkbox has been removed. I’ve double checked and made sure the tag is in the Before Body End and I’ve updated the boxToAppend. Any ideas?

Here’s the page: http://begin.fightingforyou.com/auto-accident/

Userlevel 6
Badge +4

Hi @Trevor_Breslin! Yes, this is possible. I had to dig up a page from “the archives” for this one. The links to fonts etc are broken for this page, but you will be able to see the how to stick something vertically. In this case it’s a form, not navigation. Hope this helps!

Version with form sticking to the far left
https://dev.conversionlab.no/floating-form/f.html

Version with form fixed
https://dev.conversionlab.no/floating-form/g.html

CSS Code for far left

    #lp-pom-box-77 {
    position: fixed;
    top: 6%;
    left: 0;
  }

Code for fixed box (some media specifics in there too, but you get the idea)

  @media (min-width: 320px) {
    #lp-pom-box-77 {
    position: fixed;
    top: 8%;
    left: 1%;
  }
    
  @media (min-width: 900px) {
    #lp-pom-box-77 {
    position: fixed;
    top: 8%;
    left: 3%;
  }
  }
  
  @media (min-width: 1200px) {
    #lp-pom-box-77 {
    position: fixed;
    top: 8%;
    left: 8%;
  }
  }
    
 @media (min-width: 1430px) {
    #lp-pom-box-77 {
    position: fixed;
    top: 8%;
    left: 19%;
  }
  }

Is it possible to fix the header vertically but not horizontally? Thanks!

Thanks for the resource! Got it to work super smoother for my footer, but I want to use the javascript across all my pages and variants— so I need it to work with a custom css class— not just the id block. I tried to insert my custom class in there, and it kinda worked, but not completely. Does anyone have any insight into how it can be made to work consistently using a css class? Thanks al!

Hi, is there a way to make the banner appear ONLY when we scroll past a certain section or after 15% of the page…

The sticky contains the same CTA button like the one in the header, and we don’t want to show it twice when the page loads. Only when the user scrolls down and doesn’t see the CTA button in the head section.

Never mind it works.

yes I did.

It doesn’t’ work for me. Can you please tell me how to fix it? https://www.321ignition.com/partners/

Lifesaver. I haven’t checked the Script Library checkbox. Thank you!

You’ve checked this?

https://screencast.com/t/gXaOHcmyeSHS

It doesn’t work for me! http://unbouncepages.com/partner-2060/

Hi all, I tried to insert the sticky nav header but it is not working.

  1. I referenced a Box ID (within a section) within the script.
  2. I also added the script correctly under the Before Body End tag.

Can someone help troubleshoot please? Thank you!
https://bit.ly/2Yud08l

You turned the entire section to sticky? or its a box?

I’ve tried adding this code but it doesn’t seem to work. Here is my test page.

http://unbouncepages.com/landing-page-23846283854/

Thanks.

Joel

I can’t seem to make my headerbar sticky. I created a box element in the top of my page and
I have changed the box ID to the ID of my box in the javascript. Can somebody help me look into where the mistake can be?

When I then add the stylesheet for fading, the bar completely disappears. So it seems that the stylesheet part triggers but the script for the bar has an error.

http://borsenlive.dk/bec/

Thanks in advance.

Userlevel 5
Badge +2

Hi @RogueMarketing!

Could you share a link to your page? That will help us find what went wrong!

Thank you,
Caroline

Hello - I’m having the same issues as Elias and feezy mentioned above. My elements in front of the box are not showing. Can you please help?

I’m having the same issue as Elias — the sticky header works, but none of the elements are visible in Preview. 😦

Hello,

I have added the script and replaced the id with my id. After that the sticky header is working but the elements of the header are not showing!

Page link: http://unbouncepages.com/roofing-replacement-page/

Please help me solving this issue.

Thanks

Userlevel 6
Badge +3

Hey @carpz - you just need to put all the content into a box within the section and update the script to that box id 🙂

You currently have everything in lp-pom-block-398 from what I can see, but the script actually references lp-pom-box-398.

Here’s an example from on my old landing page -

The the box is what holds the content and is referenced in the script -

@Zoe_Tattersall Could you assist with mine? Can’t seem to make it work.

www.leadaccess.co.uk/test

Thanks!

Userlevel 6
Badge +3

Sure @alyssawee – I’ll msg you now

Could you help me with the sticky header?

Thanks!

Reply