From a0212e8d4a24b4c02c079f1bcc6a430b9c3986a8 Mon Sep 17 00:00:00 2001 From: Igor Barsi Date: Thu, 26 May 2016 21:09:54 -0400 Subject: [PATCH] - Evenly distribute aria-describedby tags through available dots. --- slick/slick.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/slick/slick.js b/slick/slick.js index 48cad3710..97f5d8197 100644 --- a/slick/slick.js +++ b/slick/slick.js @@ -1288,8 +1288,11 @@ _.$slides.not(_.$slideTrack.find('.slick-cloned')).each(function(i) { $(this).attr('role', 'option'); + //Evenly distribute aria-describedby tags through available dots. + var describedBySlideId = _.options.centerMode ? i : Math.floor(i / _.options.slidesToShow); + if (_.options.dots === true) { - $(this).attr('aria-describedby', 'slick-slide' + _.instanceUid + i + ''); + $(this).attr('aria-describedby', 'slick-slide' + _.instanceUid + describedBySlideId + ''); } });