Skip to content Skip to sidebar Skip to footer

Owl Carousel - Slide Multiple Carousels With Just One Dots Carousel Slide

I have two carousels that I wanted to used, they both have the same amount of items so it will be fine, BUT I want only to have one navigation dots and be able to trigger multiple

Solution 1:

This this click handler:

$('.div_main .owl-dot').click(function(e) {
  e.preventDefault();

  if(!$(this).is(".active"){
   var idx = $(this).data('index');
   $("[data-index='"+idx+"']").not(this).click();
  }
});

Notice the .not(this)!

You had the error, basically because you where saying: «On click on me, click on me.»... Which cause the maximum stack error.

So also checking if the dot already is active will stop the infinite looping.

Post a Comment for "Owl Carousel - Slide Multiple Carousels With Just One Dots Carousel Slide"