B
B
Breeze12019-09-19 12:59:13
css
Breeze1, 2019-09-19 12:59:13

How to make active all slick dots before the current one?

https://codepen.io/brezze/pen/oNvaKGy

It is necessary that the active class of slick dots remains on all previous slides.

For example, if we click on the third slide, the active class remains at the first, second, and third dots. If we are on slide 4, the active class is for all points. If on the first, only on the first and so on.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0xD34F, 2019-09-19
@Breeze1

By default, let the buttons be red (like active), and recolor those that are located after the active one in blue (inactive):

.slick-dots {
  li button {
    background-color: red;
  }

  li.slick-active ~ li button {
    background-color: blue;
  }
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question