Slick carousel + custom ARIA pagination dots

Replacing the default dots <button> that comes by default with the jquery SLICK.

by MartinDubeNet

HTML

<script src="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.4.0/slick.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.4.0/slick.min.css">
<div class="slideshow">
    <img src="http://lorempixel.com/500/250" />
    <img src="http://lorempixel.com/500/251" />
    <img src="http://lorempixel.com/500/249" />
</div>

CSS

.custom_paging li {
  margin: 0 0 0 .5em;
  display: inline-block;
  list-style: none;
}
.custom_paging li:first-child {
  margin-left: 0;
}
.custom-dot {
  display: block;
  width: 12px;
  height: 12px;
  background-color: white;
  border: 3px solid gray;
  border-radius: 50%;
  cursor: pointer;
}
.slick-active .custom-dot {
  background-color: blue;
}
.custom-dot .string {
  position: absolute;
  left: -99999px;
  line-height: 0;
  opacity: 0;
}

JavaScript

$('.slideshow').slick({
    slide: 'img',
    autoplay: true,
    dots: true,
    dotsClass: 'custom_paging',
    customPaging: function (slider, i) {
        //FYI just have a look at the object to find aviable information
        //press f12 to access the console
        //you could also debug or look in the source
        console.log(slider);
        var slideNumber = (i + 1),
            totalSlides = slider.slideCount;
        return '<a class="custom-dot" role="button" title="' + slideNumber + ' of ' + totalSlides + '"><span class="string">' + slideNumber + '/' + totalSlides + '</span></a>';
    }
});