Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search
  • 0

7.1 Force Hamburger Menu with iPad


jonongec

Question

Site URL: https://www.jonathanong.com

I've done a Split Navigation using Custom CSS which works fine for desktops. But on the Ipad the links seem to jump to the next line under the logo. Is there a way to force the navigation links into a hamburger menu like on the mobile?

532177592_ScreenShot2020-12-23at8_38_18pm.thumb.png.b5f170aaba874dd7a59bb313157c3347.png

 

I tried using this code but then the logo went off center. Can anyone help?

@media screen and (min-width:768px) {
 /* hide navigation */
    .header-nav {
    display: none;
}
/* Hide header button */
.header-actions {
    display: none;
}
/* show burger */
.header-burger {
  display: flex;
}
/* Show overlay mobile menu */
.header--menu-open .header-menu {
opacity: 1;
visibility: visible;
}
}

Screen Shot 2020-12-23 at 8.42.30 pm.png

Link to post
  • Answers 12
  • Created
  • Last Reply

Top Posters For This Question

12 answers to this question

Recommended Posts

  • 0

Your split nav doesn't work below 988px. That's when the nav moves to 2 lines. You're seeing this on your iPad due to its screen dimensions, but remember that it will appear like this for anybody on a smaller laptop screen or with a smaller browser window. Hamburger doesn't kick in until 800px or less.

I suggest amending your custom CSS to lay the navigation out to work perfectly at 800px. Then test it see how it grows to fit a bigger screen, rather than the other way around. Otherwise, you'll want to change the media queries to have your hamburger kick in at 988px, which feels a little large to be switching to a mobile nav, but that's your call.

Link to post
  • 0
On 1/7/2021 at 9:29 AM, jonongec said:

Strange, on my iPad Air it’s like my first screenshot where the navigation goes into a second line. @tuanphan

Try this new CSS

@media screen and (min-width:768px) and (max-width:1024px) {
 /* hide navigation */
    .header-nav {
    display: none;
}
/* Hide header button */
.header-actions {
    display: none;
}
/* show burger */
.header-burger {
  display: flex;
}
/* Show overlay mobile menu */
.header--menu-open .header-menu {
opacity: 1;
visibility: visible;
}
}

 

Link to post
  • 0

@tuanphan

hmmm that’s strange. On my iPad Air it’s still the 2 lined navigation.

My website currently doesn’t have your code, so is it possible you are seeing it on a smaller screen hence automatically going to burger menu? When I tilt my iPad vertically I also see the burger menu.

Link to post
  • 0

@tuanphan

I've done a screen recording of me minimizing my screen on my desktop to the point where the navigation becomes 2 lines



are you able to help me code it such that it will never be 2 lines but instead jump to burger menu? thank you in advance!

Link to post

Create an account or sign in to comment

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


×
×
  • Create New...