Having a pure CSS slider, I included dot indicators to show the current slide. However, there are also numeric indicators outside of the slider that I want to change the color of.
The CSS code for the working indicators looks like this:
input#img-1:checked ~ .nav-dots label#img-dot-1,
input#img-2:checked ~ .nav-dots label#img-dot-2,
input#img-3:checked ~ .nav-dots label#img-dot-3 {
background: rgba(0, 0, 0, 0.8);
}
Unfortunately, this code does not work for changing the color of the numeric indicators:
input#img-1:checked ~ #title label#slide-link-1,
input#img-2:checked ~ #title label#slide-link-2,
input#img-3:checked ~ #title label#slide-link-3 {
color: red;
}
If there are more than three slides, the same issue persists. To view the code and problem, check out my codepen here: http://codepen.io/anon/pen/ZbPvde
Is there a way to achieve this using CSS alone, or could you please provide guidance on how to solve it with jQuery? Thank you for your help.