I
I
intriga932020-10-20 16:28:50
JavaScript
intriga93, 2020-10-20 16:28:50

How to make sliders work separately?

or rather, they switched,
because now in each item there are several of them (instead of one block .block__arrows )

if you make one slider on the page - everything is correct,
but two or more - no
https://jsfiddle.net/ca5d0uq8/3/

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vitaliy Pershin, 2020-10-20
@intriga93

We loop through each block with a slider, find the necessary elements in it and initialize it:

F
FasterTans, 2020-10-20
@FasterTans

var events = $('.block__gallery');
Initialize each slider with a new class, preferably an id

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question