Jump to content

Mobile Menu - Hide Folders - Previous Code Not Working Anymore

Go to solution Solved by Web_Solutions,

Recommended Posts

Posted

Hi, my site www.perfectcapturebooth.com is multi-lingual and I was previously successful at hiding certain folders with certain pages. But now it seems for mobile, all of the folders are being shown in the menu!

These are the codes that I was using, the desktop code still works properly. Mobile isn't working Please help! :

<style>
    /* hide items on desktop */
  nav.header-nav-list>div:nth-child(1),
    nav.header-nav-list>div:nth-child(3), nav.header-nav-list>div:nth-child(4) {
        display: none;
    }
    /* hide items on mobile */
     .header-menu-nav-list [data-folder="root"] .header-menu-nav-folder-content > div:nth-child(1), .header-menu-nav-list [data-folder="root"] .header-menu-nav-folder-content > div:nth-child(3), header-menu-nav-list [data-folder="root"] .header-menu-nav-folder-content > div:nth-child(4)
  {
  display: none !important;
}
    </style>

  • Solution
Posted
1 hour ago, PerfectCaptureBooth said:

Hi, my site www.perfectcapturebooth.com is multi-lingual and I was previously successful at hiding certain folders with certain pages. But now it seems for mobile, all of the folders are being shown in the menu!

These are the codes that I was using, the desktop code still works properly. Mobile isn't working Please help! :

<style>
    /* hide items on desktop */
  nav.header-nav-list>div:nth-child(1),
    nav.header-nav-list>div:nth-child(3), nav.header-nav-list>div:nth-child(4) {
        display: none;
    }
    /* hide items on mobile */
     .header-menu-nav-list [data-folder="root"] .header-menu-nav-folder-content > div:nth-child(1), .header-menu-nav-list [data-folder="root"] .header-menu-nav-folder-content > div:nth-child(3), header-menu-nav-list [data-folder="root"] .header-menu-nav-folder-content > div:nth-child(4)
  {
  display: none !important;
}
    </style>

 

Replace your code with these

<style>
  /* hide items on desktop */
  nav.header-nav-list>div:nth-child(1), nav.header-nav-list>div:nth-child(3), nav.header-nav-list>div:nth-child(4) {
    display: none;
  }
  /* hide items on mobile */
  .header-menu-nav-list [data-folder="root"] .header-menu-nav-folder-content .header-menu-nav-wrapper > div:nth-child(1), .header-menu-nav-list [data-folder="root"] .header-menu-nav-folder-content .header-menu-nav-wrapper > div:nth-child(3), .header-menu-nav-list [data-folder="root"] .header-menu-nav-folder-content .header-menu-nav-wrapper > div:nth-child(4) {
    display: none !important;
  }
</style>

 

If my comments are useful, please like and mark my solution as answer. It will encourage me. Thanks

MD Rofik
Website Designer and Digital Marketer

Am I helpful? Want to offer me a coffee?
Send me a message if needed any help. I'll try to reply as soon as possible.


 

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.