How To Remove Aria-Described By if Dots are Disabled in Slick Slider

Need to remove the aria-described by tag if no control dots are needed? Try this:

This allows Slick Slider to pass accessibility testing.

Change “.slide-title” to your respective class name.

$(‘.slide-title’).each(function () {    var $slide = $(this).parent();        if ($slide.attr(‘aria-describedby’) != undefined) { // ignore extra/cloned slides        $(this).attr(‘id’, $slide.attr(‘aria-describedby’));    }});

Sources: https://github.com/kenwheeler/slick/issues/2020

Zedric Myers
Zedric Myers is a Web Designer for Beacon Technologies. After earning his degree in Advertising and Graphic Design, he spent 11 years with an advertising agency in Greensboro, NC where he was initially hired as a designer and transitioned to being a Web Developer.
By | 2017-11-16T12:22:32+00:00 November 16th, 2017|Web Development|Comments Off on How To Remove Aria-Described By if Dots are Disabled in Slick Slider
Load More Posts