MGHCCCSEW Posted December 29, 2020 Share Posted December 29, 2020 Site URL: http://www.mghstudentwellness.org We are trying to make the top menu bar of our website a bit more dynamic, by having different options highlight when you hover over them, and the top level category (e.g., Resources) remain underlined when anything within that menu is clicked, to help with navigation/not losing one's place. Currently this happens only for the "What we do" item. I have very basic Square Space editing skills. Can anyone help? Thank you! Beyondspace 1 Link to comment
Beyondspace Posted December 30, 2020 Share Posted December 30, 2020 11 hours ago, MGHCCCSEW said: Site URL: http://www.mghstudentwellness.org We are trying to make the top menu bar of our website a bit more dynamic, by having different options highlight when you hover over them, and the top level category (e.g., Resources) remain underlined when anything within that menu is clicked, to help with navigation/not losing one's place. Currently this happens only for the "What we do" item. I have very basic Square Space editing skills. Can anyone help? Thank you! I saw you use jQuery and some other js code snippet to replace the folder url, kindly replace all of them with this <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script> <script> var folder_link = [ { href: "/what-we-do", target: "/our-services-1" }, { href: "/who-we-are", target: "/about-us" }, { href: "/resources-2", target: "/resources" } ] $(document).ready(function() { $(document).on('click', '.header-nav-folder-title', function(e) { var folder_href = $(this).attr("href"); var folder_item = folder_link.filter(function(f) { return f.href == folder_href; }); if ( folder_item[0] ) { window.location = folder_item[0].target; } e.preventDefault(); return false; }); var current_path = window.location.pathname; var matched_folder_item = folder_link.filter(function(f) { return current_path == f.target; }); if ( matched_folder_item[0] ) { $('.header-nav-folder-title[href="'+matched_folder_item[0].href+'"]').closest("div").addClass("header-nav-item--active"); } }); </script> tuanphan 1 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 pluginIf 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
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment