Jump to content

Custom hamburger/overlay menu on desktop: z-index issues

Recommended Posts

https://cuboid-guppy-5ab6.squarespace.com/
Site password: heather

 

Hi! I've used some custom CSS to have a hamburger menu on desktop view, but I'm having an issue:

When the overlay menu is open on desktop, my menu links are aligned at the top and my first item is inline with the "x" to close the menu. The header (logo and hamburger icons) seems to be "in front" of everything else, which means the user isn't able to click on my first menu item. Is there a way to bring my link items all the way to the front so that the first item can be clicked? I was having trouble achieving this without losing the "x" icon all together.

Additionally, when the menu is open I'm still able to scroll the page in the background and the header (logo and hamburger icons) scroll out of view. I'd like to disable all scrolling when the menu is open, so no scroll on the page behind OR on the overlay menu. Is this possible?

Thanks in advance!

Link to comment
  • Replies 3
  • Views 726
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

  • 2 weeks later...
On 7/24/2024 at 1:53 AM, LoftyDevs-Website-Designer said:

Hello @heatherjacksonio,

Please update your CSS with the following:

.header-menu-nav-wrapper { margin-top: 48px; }

Hi! Thank you so much for responding. I actually was hoping to find a solution that wouldn't shift my menu items down, since we like the look of the items being aligned at the top as they are. Is it possible to leave everything aligned as is, but allow for the first item to still work as a link?

Link to comment
On 8/6/2024 at 8:25 PM, heatherjacksonio said:

Hi! Thank you so much for responding. I actually was hoping to find a solution that wouldn't shift my menu items down, since we like the look of the items being aligned at the top as they are. Is it possible to leave everything aligned as is, but allow for the first item to still work as a link?

If doing this, burger menu X icon will disappear (or non-clickable) (or you need to move burger to another position)

add z-index: 9999; to your current code

image.png.3dc2364eab651bbcf4587e56ddfcdd31.png

move burger with a code like this

@media screen and (min-width:768px) {
body.header--menu-open .header-burger {
    position: fixed;
    left: 40%;
}
}

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.