Jump to content

Navigation Bar coding

Recommended Posts

Site URL: http://nickpiper.tv

I have three options for users to click in my navigation bar.

FILMS    ABOUT    PEOPLE

There is a secondary drop down menu under the PEOPLE link that reveals three options for users to click on:

PEOPLE

EFFECTS

CARS

When users click on these links is there a way to make the navigation bar update to show the title of the drop down menu page, so for example if a user selects EFFECTS, then the navigation bar updates to:

FILMS   ABOUT   EFFECTS

I understand this will require some unsupported code editing, but I'm hoping someone has a clever trick they can share.

Thanks

Edited by nickjamespiper
Link to comment

You can insert this snippet in the FOOTER

Settings -> Advanced -> Code Injection
 

<script>
(function() {
	var matchedUrl = location.href.replace(location.origin, "")
    var linkItem = document.querySelector('.Header-nav-folder-item[href*="'+matchedUrl+'"]');

    if (linkItem) {
        linkItem.parentNode.previousElementSibling.innerText = linkItem.innerText;
    }
})();
</script>

 

Greeting, it's BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.
Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Lightbox Studio plugin
If you find my answer fit your need, let's leave a like or upvote so others with the same issue can find their solution. 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.