Jump to content

How to get nav folder custom link to work on mobile?

Recommended Posts

Site URL: http://www.noelcoward.com/

Hi all - 

I have javascript on my site that makes the parent nav folder in a secondary menu clickable. Necessary because the site is combining three existing sites into one.

But this parent folder item isn't clickable on mobile.

Here is the code as I have it:

<script>
$(document).ready(function() { 
	$('a.header-nav-folder-title[href="/Foundation-1"]').click(function() {
		window.location = "/foundation";
	});
   $('a.header-nav-folder-title[href="/archive-trust-1"]').click(function() {
		window.location = "/archive-trust";
	});
   $('a.header-nav-folder-title[href="/about-noel-coward"]').click(function() {
		window.location = "/bio";
	});
   $('a.header-nav-folder-title[href="/noel-coward-room-1"]').click(function() {
		window.location = "/noel-coward-room";
	});
});
</script>

What code do I need to add so that the nav folder is clickable on mobile?

Edited by ryanjpointer
Link to comment
  • ryanjpointer changed the title to How to get nav folder custom link to work on mobile?
  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Edit this

$('a.header-nav-folder-title[href="/Foundation-1"]').click(function() {
		window.location = "/foundation";
	});

to this

$('a.header-nav-folder-title[href="/Foundation-1"], .container.header-menu-nav-item [href="/Foundation-1"]').click(function() {
		window.location = "/foundation";
	});

Do similar for other items.

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

How to: Setup Password & Share url Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

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.