I
I
Ivan Simonov2018-04-10 11:36:18
JavaScript
Ivan Simonov, 2018-04-10 11:36:18

How to bind pagination to each slider separately?

Used 2 sliders bootstrap 3 - Fiddle

Slider now uses data-attribute instead of id.

When loading everything is ok.

When you click on the 2 dot of the 1st slider, the active class for the 1st dot of the slider 2 is removed, and so on. for others the situation is similar.

How to bind dots (carousel-indicators) to the slider separately? - .ie, clicking on the dot of the 1st slider does not affect the dot of the 2nd slider.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0xD34F, 2018-04-10
@ivansimonov1984

So? -

$(document).on('click', '[data-slide-to]', function() {
  $(this).closest('.carousel').carousel(+this.dataset.slideTo);
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question