stringbryce Posted April 11, 2021 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 Posted April 15, 2021 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> BeyondSpace - Squarespace Website Developer 🖼️ Lightbox Studio (Pinch/Zoom images, videos - PDFs Lightbox - ...) </> 🗓️ Delivery Date Picker (Date picker form field) Gallery block 7.1 workaround </> 🤖 Ask me anything
stringbryce Posted April 26, 2021 Author Posted April 26, 2021 sorry could you adapt the code so it only applies to Gallery and Menu nav items?
Recommended Posts
Archived
This topic is now archived and is closed to further replies.