stringbryce Posted April 11, 2021 Share Posted April 11, 2021 Site URL: http://aldenteenoteca.com Hey can someone provide me with code to change the color of the nav item when its on that page, tried looking everywhere else not working Beyondspace 1 Link to comment
Beyondspace Posted April 15, 2021 Share Posted April 15, 2021 On 4/11/2021 at 4:22 PM, stringbryce said: Site URL: http://aldenteenoteca.com Hey can someone provide me with code to change the color of the nav item when its on that page, tried looking everywhere else not working Add this into Advance-Code injection, change color red to whatever you like <style> .header a.active-page { color: red !important; } </style> <script> document.addEventListener('DOMContentLoaded', function() { var currentPage = location.hash ? location.pathname + location.hash : location.hash; var _a = document.querySelectorAll('.header a[href*="'+currentPage+'"]'); for (var i = 0; i < _a.length; ++i) { _a[i].className += _a[i].className + " " + "active-page"; } }); </script> tuanphan 1 BeyondSpace - Squarespace Website Developer 🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox) 🗓️ Delivery Date Picker (Squarespace Date picker form field) 💫 Gallery block 7.1 workaround 🥳 Sparkplugin Customisations Browsers (Browse +100 Spark plugin customisations) 🥳 Elfsight Template Browsers (Browse +1000 Elfsight widget Templates) If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you! Link to comment
stringbryce Posted April 26, 2021 Author Share Posted April 26, 2021 sorry could you adapt the code so it only applies to Gallery and Menu nav items? 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