Jump to content

Hide Folder on Mobile

Recommended Posts

I have created two folders, one I wish to display on the nav bar on desktop and one I want to display while on mobile. 

Does anyone know what custom CSS is required to display the folders based on screen size?

I've found examples online for displaying blocks based on size but nothing related to the navbar folders/links. 

Link to comment
24 minutes ago, AprilRains said:

https://www.aprilrainsphotography.com/ - Right now only one folder is enabled (Featured Collections) but I want this hidden on mobile and then I would set up the site to display another folder in it's replacement. 

Add this code to Home > Design > Custom CSS

@media screen and (max-width:640px) {
nav.Mobile-overlay-nav.Mobile-overlay-nav--primary .Mobile-overlay-nav-item:nth-child(2) {
    display: none;
}
}

Create another folder to the right of Featured. Because if you create on the left, the code will need to be changed to nth-child(3)

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
  • 2 months later...

Hi Tuanphan,

I am trying to implement a multilingual option following the following tutorial: https://www.bradgood.net/articles/multi-language-content-on-any-squarespace-template

I have suceeded making it work on computers, but in mobile devices it doesn´t hide the folders that don´t belong to the selected language. I think it is something to do with the class name of the folders inside the main menu when they are displayed in a mobile device.

https://www.ideaitor.com/

It seems other people had the same issue but the solution proposed below didnt work for me. Any clue how I can fix this?

 

Thank you in advance 😄

 

image.png.efff09bec77407b80a577e7cc096c405.png

image.png.c1a031a89666b1c0ec1fa5f0c89def64.png

Edited by Aitor
Link to comment
  • 2 months later...
11 hours ago, JohanMinnebo said:

Hi @tuanphan, thank you for your excellent solutions.

I have a similar question to the one above: how do I hide an item inside a folder on mobile?
I followed another tip of yours of adding hidden blank nav items inside my 2 column navigation to space it out evenly. And I'd like to do the same on mobile.
our website: improbubble.com

Use this

a.Mobile-overlay-folder-item[href="/level-6"] {
    visibility: hidden;
}

OR this

a.Mobile-overlay-folder-item[href="/level-6"] {
    display: none;
}

with leve-6 is page url

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
  • 1 month later...
5 minutes ago, veganedge said:

how would you write this code for 2 or 3 items inside a folder?   Is there a more efficient way than doing this for each one?

[href="/level-6", "/level-7", "/level-8"] ???

Can you share link & Which items?

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
  • 2 years later...
4 hours ago, HMagorRoberts said:

Hi @tuanphan

I have a similar issue, on mobile I want to hide the main folder and just have the direct page links?

So remove this first click:

image.thumb.png.a64e2301adb19071811131070522cabc.png

then the burger icon opens this page only:

image.thumb.png.6c4551d628e46cfc4c37e23991cd9551.png

Is this possible? and could i also take off the back button?

Thankyou!

Possible. If you share site url, we can check easier

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
  • 6 months later...
On 1/5/2023 at 10:41 AM, TheClimbCollaborative said:

Hi @tuanphan 

I am having the same issue with wanting to remove the main folder on mobile and just have the direct page links. Are you able to help? 

Website is www.glowlyoralcare.com.au Password: GLOWUP2023

 

Thanks

Hi,

I see you figured it out?

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
  • 3 weeks later...

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.