Jump to content

Menu that stays on top but doesnt start on top.


Guest

Recommended Posts

I have a menu that begins at 153px from the top I can make it fixed to scroll with the page but the thing is I want it to scroll to the top of the page then stay with me as I scroll down. So as I scroll down I want it to go from 153px to 0px and stay there then going back up go back to 153px. I have tried google but dont know what exactly to search for explaining it is difficult at least from my knowledge. Can some one point me in the right direction or tell me what kind of fixed relative combination I have to have. Thank You

I've done this in the past, but it cannot be done purely with CSS, it requires some javascript as well.

 

When I did this, on page load, I cloned the element I wanted to show, positioned it at the top of the page, and set it to display:none. Then on page scroll, I check to see if the actual menu is on the screen, and if it's not, then to show the cloned element.

 

Moving this to javascript.

Archived

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

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.