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



Show first post

156 replies

I have also attempted this but am unable to change the box ID data. Also not sure what to replace that ID with. “Replace the box ID with your own boxes ID:” HUH?!

This was the test url - The page was mostly thrown together to test the script, so not clean at all.

When you scroll the sticky element will move from the first section to the second, but for some reason lacks the smooth transition sliding between the two positions.

There may be some additional css that is missing (external stylesheet in the example?).

Didn’t spend a lot of time figuring it out, but if you have any suggestions or can see something I missed, it’s a great feature and would love to be able to include.

Example located here:
http://www.eclipse-page.info/sticky-sidebar-test-1/

Hi Jeff - what do you mean? Can you provide the url?

Almost works - tried this and the box moves but don’t get the smooth transition between page sections.

OK Found it!

Can you modify the code so a selected element sticks to the top or bottom of selected section of a page? Good usage example is here - http://unbouncepages.com/horse-unbounce-landing-page-1/ (about us section)

Hi! All the elements in the box  are moving to the left, Anyone else experiencing this problem?  

Looks great, Jordy! 😃

Works like a charm! > https://get.seoshop.com/webwinkel-software/

I have implemented it here: http://go.jewcer.com/howitworks/

I put an iframe in the header and made it sticky. Any idea why the iframe shows on Android phones but not on iphones? 

ADDITION:
In fact, this code for a sticky header prevents any iframe to be shown on iphones, anyone has a fix for this?

so how do i remove #lp-pom-block-8 in my ID? 

Userlevel 3

Hey Amir/Joe - Sorry for the confusion. I’ve updated the post to include the placement of the script.

Thanks for pointing that out!

Thank you! I was going bonkers wondering why it wasn’t working.  That solved the problem!

Does this type of thing only work if you are using the paid version?  I set it up exactly as written and no dice.  Even trying to link to an id isn’t working.  I am still in the “eval” phase but almost ready to do a major launch of unbounce.  I’m just focusing on some of the advanced features now.

Thanks Jeff! If you have any crafty workarounds, please be sure to share them as well. :) 

Beautiful Fix! love how creative the unbounce community is. They should consider adding some of these items as regular features in the platform.

Thanks so much for this!

Userlevel 6
Badge +4

Love this, thanks!

Johnny, you’re a saint. This script has been extraordinarily helpful with my landing pages. Thank you!

Userlevel 3

Ah nice catch JP. It looks like you found a bug.

I’ve went ahead and made some adjustments to the script. If you grab the updated script below you shouldn’t see that issue.

https://gist.github.com/johnnyopao/896e042fe7daac49d119

Let me know if you find anything else!

Hey Johnny,

Thanks very much for this. It was a lifesaver.

I’m having some trouble with the header version of this on mobile though. It works, it’s just that it creates a small border box when the person initially scrolls down. To really see the problem, open it on a mobile device, not the mobile preview screen. Nonetheless, it shows up in a similar but different way on there as well.

My site: www.solanocontractors.com

Your help with this is very much appreciated and thanks again!

Userlevel 3

Hey Cory! I don’t have any plans to make a script like that but I think it would be possible by making some modifications to my existing script. If you are familiar with modifying CSS I suggest taking a shot at it.

I’m thinking you’ll mainly modify the ‘width’ and ‘height’ CSS properties. Hope that helps!

Wow that works pretty well.  How about a script that stretches it vertically instead of horizontally?  I would like a box that goes on the side.  How about one that doesn’t stretch it at all?

Wow that works pretty well.  How about a script that stretches it vertically instead of horizontally?  I would like a box that goes on the side.  How about one that doesn’t stretch it at all?

Worked like a charm. Thanks Johnny!

Reply