This solution allows you to create a full-width header, have it fixed to the top of your page, and have it fade in and out when a user scrolls on your landing page. This is a great way to hold off on showing your header/navigation until you feel it is needed. This can help create a clean, uncluttered look for your pages. This solution builds on Johnny’s ‘Sticky Header’ Community post.
1) See the Fading Fixed Header effect in action here .
2) Download the .unbounce template here.
🚨
This is not an official Unbounce feature. This functionality is based entirely on third party code, and has only been tested in limited applications. Since this isn’t a supported Unbounce feature, our support team will be unable to assist if things go awry. So if you are not comfortable with HTML, Javascript and CSS, please consider consulting an experienced developer.
Scripts Needed:
Grab the latest fading_fixed_header.css and fading_fixed_header.js files here:
https://gist.github.com/noahub/58e1b5be59799a9c79f7fa73e9ba9ce8
Instructions:
Step 1.
Create a box element in the editor for your fixed header and style it to your liking.
Step 2.
Copy and paste the following snippet in the Javascript section with placement ‘Before Body End Tag’.
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>
This is the reference to the jQuery library. Next, paste the fading_fixed_header.js Javascript code below the snippet.
Step 3.
Replace “#lp-pom-box-53” with the ID of your box from Step 1.
Step 4.
Set the value of the ÒshowHeightÓ variable. This is the height (in pixels) where the Fixed Header will fade in. The larger the value, the more visitors will have to scroll before the Fixed Header fades in.
Step 5.
Paste the fading_fixed_header.css code into your Stylesheets section.
Step 6.
Replace both instances of Ò#lp-pom-box-53Ó with the ID of your box from Step 1.
Bonus: This solution can also be used for a Fading Fixed Footer. In the fading_fixed_header.js javascript, simply change the “headerOrFooter” variable from ‘header’ to ‘footer’.
Testing:
Like anything else you implement on your page, you’re going to want to test this out thoroughly to see what effect (if any) it has on your conversion rates. We recommend running an A/B test and segmenting a small portion of traffic towards the page - just to be safe.
Conclusion:
We would love to see how you implement this on your own pages. This is your chance to get creative and show the Unbounce community how you’re using this.
Did you find this tip useful? Did you test this on your landing page? Let us know in the comments below!