Skip to content

Instantly share code, notes, and snippets.

@neodigm
Created August 16, 2024 01:18
Show Gist options
  • Save neodigm/38a69f35e59d6d40a686ef6d9602c42a to your computer and use it in GitHub Desktop.
Save neodigm/38a69f35e59d6d40a686ef6d9602c42a to your computer and use it in GitHub Desktop.
Flickity A11y fix simplified
const fFlick = function(){
Array.from(document.querySelectorAll( ".flickity-slider [aria-hidden='true']" )).forEach( ( e )=>{
e.setAttribute("aria-hidden", "false")
e.removeAttribute("aria-hidden")
e.dataset.flickPoly = "1"
})
};
["DOMContentLoaded", "resize", "click"].forEach( ( evn )=>{
document.addEventListener( evn, ( ev )=>{ fFlick() })
})
setInterval( ()=>{fFlick()}, 96 )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment