A
A
Alexey Parkhomenko2015-11-10 16:47:03
JavaScript
Alexey Parkhomenko, 2015-11-10 16:47:03

How to use multiple sliders, Swiper in particular, on the same page independently of each other?

There is a landing page, you need to fasten 4 sliders. Everything works fine, but when you click on the arrows, all the sliders work and everything switches. Plus, the settings apply to everyone, not to individual ones.
I tried to access the .container-swiper class through the parent class, for example -first, -second, ..slider, - does not work out that way.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Zachinalov, 2015-11-10
@Versale

you need to create 4 variables and assign for each the creation and initialization of a specific slider

var slider1 = new Swiper ('.slider1', {
      loop: true
}) 
var slider2 = new Swiper ('.slider2', {
      loop: true
})

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question