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

By Zedric Myers | Published November 16, 2017 | Categories: Web Development

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’));    }});

Or if you want to just target the each slide itself, you can use this code for an example.
$(‘.slide’).each(function () {    var $slide = $(this);
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

Contact Us To Find Out More

Have questions? Need help? Contact us and we'll be in touch soon!

* Required

Beacon
164 Thatcher Road
Greensboro, NC 27409
Map and Directions

Sales & Marketing
336.232.5687