I was wondering if there is a way to use custom slick slider dots. When I search, all I can finds is examples on how to change the dots into thumbnails from the slides, however this is not what I’m trying to accomplish. I just want to use my own png pictures for the active and non-active dot navigation. I tried this:
JavaScript
x
3
1
$('.slick-dots li').html('<a href="#"><img src="slide-dot.png" /></a>');
2
$('.slick-dots li.slick-active').html('<a href="#"><img src="slide-dot-active.png" /></a>');
3
But that didn’t work, though I recall I did something like that before. Am I missing something here ?
Thanks!
Advertisement
Answer
You can style slick dots with CSS only and avoid using inline images:
Using background image:
JavaScript
1
7
1
.slick-dots li button {
2
background: url(path/to/your-image.png);
3
text-indent: -9999px;
4
overflow:hidden;
5
/* more CSS */
6
}
7
Using pseudo element:
JavaScript
1
8
1
.slick-dots li button {
2
font-size: 0;
3
/* more CSS */
4
}
5
.slick-dots li button {
6
content:url(path/to/your-image.png);
7
}
8