etspaulding Posted October 24, 2019 Share Posted October 24, 2019 I want my menu to be fixed at the top once a visitor scrolls past it. I'm on the Om template. Thanks! Link to comment
brandon Posted October 24, 2019 Share Posted October 24, 2019 Hi @etspaulding. Could you provide a link to the site/page in question (for trial sites, see here). Since your style settings may be a factor, a link to the site/page makes it easier for others to write and test a quality answer. If a response helped you out, send a 'Like' 👍 (bottom-right) and/or 'Upvote' (top-left) Link to comment
etspaulding Posted October 24, 2019 Author Share Posted October 24, 2019 @brandon, sure thing! http://www.hiddenhaven.org/ is our site. We'd like the menu bar to act like it does at http://www.highhillcamp.org/ Link to comment
brandon Posted October 24, 2019 Share Posted October 24, 2019 Here you are. Insert this via the CSS Editor: @media only screen and (min-width: 767px) { #header { position: sticky; top: 0; z-index: 9999; background-color: #F0F4F4; } } A few notes: This doesn't affect the mobile header/navigation. To do that properly, you'd need to use JavaScript. If at some point your body background color becomes different than your header color, things would get more complicated. The code above will work in modern browsers, but not older ones. Older ones will simply have the non-fixed header (not a big deal). If a response helped you out, send a 'Like' 👍 (bottom-right) and/or 'Upvote' (top-left) Link to comment
etspaulding Posted October 24, 2019 Author Share Posted October 24, 2019 @brandon, excellent! Thank you!! Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.