Guest Posted December 18, 2010 Share Posted December 18, 2010 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 Quote Link to comment https://forums.phpfreaks.com/topic/222057-menu-that-stays-on-top-but-doesnt-start-on-top/ Share on other sites More sharing options...
haku Posted December 19, 2010 Share Posted December 19, 2010 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. Quote Link to comment https://forums.phpfreaks.com/topic/222057-menu-that-stays-on-top-but-doesnt-start-on-top/#findComment-1149162 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.