Jump to content

Clickable Dropdown Title Burger Menu

Go to solution Solved by HoaLT,

Recommended Posts

  • Replies 8
  • Views 867
  • Created
  • Last Reply

Top Posters In This Topic

4 hours ago, _yohandeschamps_ said:

Hello. 

I realized that I was unable to make the Dropdown Title clickable when I was using Burger Nav on the Desktop.

I understand the reason why, as it works like on mobile, but I was wondering if it will be possible to do it.

My website is https://www.yodeschamps.com/.

 

Thank you

Clicking on it will show the subnav

image.thumb.png.e286eeaa8f94ef588709c192a11b0de3.png

I check it works properly now. Or you want to have any other feature here?

Press 👍  or mark my comment as solution if you find my sharing useful

🆒 Squarespace pinchzoom lightbox plugin (affiliate link)

👁‍🗨 360 degree photo viewer (affiliate link)

Link to comment
  • Solution
Posted (edited)

It is possible to implement js code. You can try adding the following code on the footer injection

<script>
  document.addEventListener("DOMContentLoaded", (event) => {
    const dropdownLinks = document.querySelectorAll('.header-menu-nav-item > a[data-folder-id]');
    if (dropdownLinks.length) {
      dropdownLinks.forEach((link) => {
        link.addEventListener('click', function(event) {
          event.preventDefault();
          const hrefTo = event.target.getAttribute('href');
          window.location.href = hrefTo;
        });
      })
    }
  });
</script>

However, if we implement redirection to another page when clicking on the dropdown, it will prevent client users from opening the dropdown to access sub nav

 

Edited by HoaLT

Press 👍  or mark my comment as solution if you find my sharing useful

🆒 Squarespace pinchzoom lightbox plugin (affiliate link)

👁‍🗨 360 degree photo viewer (affiliate link)

Link to comment
On 7/24/2024 at 9:54 PM, Estherjoy said:

Hi 
Goodday please I need similar help with a website i am working on 
https://africa-thryves.squarespace.com/

Password ; Africa thryves
I want the dropdown shop to be linked to that shop page that's currently there
And have the rest as a normal dropdown under it that way i don't have two shop

You can follow this code

https://forum.squarespace.com/topic/298872-can-i-add-a-dropdown-menu-to-an-existing-navigation-page/?do=findComment&comment=755888

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.