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?

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

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

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.