Jump to content

create clickable folder by extending padding of first in dropdown menu

Recommended Posts

Hi everyone, 

I hope you can help me with an issue. On my website frameplay.tv I use a dropdown menu. Unforunately the main folder is not clickable. I found a tutorial that advised to extend the clickable padding of the first item. But it won't work. Anyone knows the solution?
 

Here is the code from this tutorial: .header-nav-folder-item:first-of-type a { padding-top:2rem; margin-top:-2rem; }

 

Link to comment
  • Replies 5
  • Views 1.9k
  • Created
  • Last Reply

Top Posters In This Topic

On 7/20/2023 at 6:49 PM, Wotje said:

 Hi @tuanphan! Yes exactly, I also want to be able to click on the WORK and than be directed to "All works" (frist in the menu). I suppose with Code Injection something is possible, but I thought to figure it out in CSS. Any help or tips?

Add this to Settings > Developer Tools > Code Injection > Footer

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script>
$(document).ready(function() { 
		$("ul>li:nth-child(1)>a").click(function() {
			var link = $(this).text(),
				href = "/";
			window.location.href=href;
		});
  		$("ul>li:nth-child(2)>a").click(function() {
			var link = $(this).text(),
				href = "/over-wouter";
			window.location.href=href;
		});
});
</script>

 

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...
On 10/20/2023 at 10:33 PM, CoorlasArchitecture said:

Does this script need to be altered to function properly? Or is is a simple copy paste?

Just add it to Website Tools (under Not Linked) > Code Injection > Footer

Note: This code works with template in the question. If your site uses another template or SS 7.1, it won't work, you will need new code (You can 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

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.