Menu icon Foundation
How to keep topbar fixed on mobile with anchor links

Hello,
Does anyone have any ideas for how to make the topbar remain fixed when viewing on a mobile and an anchor link is selected from the menu?

For instance, if you have your topbar fixed and are viewing it on a mobile, and then you select a link that points to an anchor point on the same page, the browser will skip down to that anchor point, but the topbar does not come with it.

Thanks,
Ed

topbarmobilefixed

Hello,
Does anyone have any ideas for how to make the topbar remain fixed when viewing on a mobile and an anchor link is selected from the menu?

For instance, if you have your topbar fixed and are viewing it on a mobile, and then you select a link that points to an anchor point on the same page, the browser will skip down to that anchor point, but the topbar does not come with it.

Thanks,
Ed

Karl Ward over 5 years ago

Did you try to add the .fixed class to your menu?

Ed Pritichard over 5 years ago

Hi Karl,
Yes, I have the .fixed class on my menu. It remains fixed when scrolling normally. It just doesn't remain fixed if you click an anchor link to skip down to another section on the page.

Any other thoughts?

Thanks,
Ed