Last active
April 30, 2025 08:00
-
-
Save re-dev/108e5792b82b9376ff1a568fa3cd7afe to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<style> | |
/* Hide First Item in Dropdowns For ALL Dropdowns */ | |
#header .replaced-folder { | |
& + .header-nav-folder-content > *:first-child{ | |
display: none; | |
} | |
} | |
</style> | |
<!-- Clickable Folders in Squarespace from Will-Myers.com --> | |
<script> | |
window.addEventListener('load', () => { | |
if ('ontouchstart' in window) return; | |
const folders = document.querySelectorAll('.header-nav-folder-title'); | |
folders.forEach(el => { | |
if (window.getComputedStyle(el).display !== 'none') { | |
const clone = el.cloneNode(true); | |
clone.classList.add('replaced-folder'); | |
clone.tabIndex = '0'; | |
el.parentElement.replaceChild(clone, el); | |
if (clone.matches('.preFade')) clone.classList.add('fadeIn') | |
if (clone.matches('.preScale')) clone.classList.add('scaleIn') | |
if (clone.matches('.preSlide')) clone.classList.add('slideIn') | |
if (clone.matches('.preFlex')) clone.classList.add('flexIn') | |
} | |
}); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment