K
K
kryamk2021-07-09 23:33:49
JavaScript
kryamk, 2021-07-09 23:33:49

How to switch to the desired slide if loop?

When you click on the links, the first slide in the list of this group should become the active slide. Without a cycle everything works fine.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0xD34F, 2021-07-09
@kryamk

let linkIndex = link.dataset.first;
<...>
mySwiper.slideToLoop(linkIndex);

What type of values ​​are in the dataset? Strings. And the index is what? Number. Well, make a number out of the string.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question