Jump to content

Mobile main navigation folder view - Momentum Template

Recommended Posts

Posted

Site URL: https://zoranmilisicphotography.squarespace.com/

Hi there, I am using the momentum template to display a clients photography folio. I created a folder within the main navigation to display 'projects'. On desktop this views fine, however on mobile, the folder is automatically expanded to view all the pages within that folder. Is there a way to view just the folder 'projects' on mobile without viewing all the pages straight up?

Password is : Zoran

Many thanks for any help at all.

Screen Shot 2022-01-19 at 8.05.47 am.png

Screen Shot 2022-01-19 at 8.06.03 am.png

  • Replies 6
  • Views 468
  • Created
  • Last Reply

Top Posters In This Topic

Posted

Thank you for your attention on this! The code indeed worked to hide the pages within the 'projects' folder. However now when you click on projects, the menu doesn't view the list of pages within the folder - it goes directly to the first page of the projects folder. Is there a way around this? I want it so when you click on 'projects', the project page list will be visible.

Thanks again

Screen Shot 2022-01-21 at 2.33.03 pm.png

Screen Shot 2022-01-21 at 2.33.46 pm.png

Posted

Add to Settings > Advanced > code Injection > Footer

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
 $(document).ready(function() { 
		$('li.folder.folders-collection a').removeAttr('href');
	});
</script>
<script>
$(document).click(function() { 
		$('li.folder.folders-collection').addClass('t-open');
	});
</script>
<style>
  @media screen and (max-width:736px) {
li.folder-link {
    display: none;
}
    li.t-open ~ .folder-link {
    display: block;
}
}
</style>

 

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!)

Posted

Hi Tuan, I have added this code but when I test this on my desktop as 'mobile view', the folder 'projects' has no active click through. Also, when I test the mobile menu on my actual phone, the projects folder is automatically expanded so it it views all pages within. Please let me know I have done something incorrectly. Thank you

Posted

Hi Tuan... Projects should be clickable so when you select, you can see the pages within this folder. At the moment, you can't click on projects when on mobile view (testing mobile view on desktop).

When on actual mobile, I have the same issue I started with - the pages within projects folder is automatically expanded.

Essentially, I just want the menu to behave like it does on all other templates.

Thank you 

Actual Phone - menu is automatically expanded.PNG

Mobile View on Desktop.png

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.