Jump to content

Nav dropdown opens on click (as stays open) and closes on click instead of hover

Recommended Posts

  • Replies 4
  • Views 292
  • Created
  • Last Reply

Top Posters In This Topic

Posted

Hi Tuanphan, thank you for your reply.

In an accessibility perspective both should do the same. So click on both text or arrow should open/close the folder. 

 

Posted

Try adding to Last Line in Settings > Advanced > Code Injection > Footer

<script>
  $(document).ready(function(){ $("div.header-nav-item--folder").click(function(){
  $('.header-nav-folder-content').toggleClass('show-folder');
});
});
</script>
<style>
  .header-nav .header-nav-item--folder:hover .header-nav-folder-content {
    opacity: 0 !important;
    position: absolute !important;
}
 .header-nav .header-nav-item--folder .header-nav-folder-content.show-folder {
    opacity: 1 !important;
    position: relative !important;
}
</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!)

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.