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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.