Owl Carousel Horizontal Thumbnail Bar- add navigation

Ramesh picture Ramesh · Oct 30, 2018 · Viewed 9.2k times · Source

I have the following owl carousel with the thumbnail bar.

Technology used here,

  1. Owl Carousel 2.3.4
  2. Owl carousel Thumbs

As you can see in the snippet it's working fine, but here I need a simple modification.

I want to avoid the horizontal scroll-bar for the thumbnail and add navigation icons < and > in the both ends that perform well.

Answer

Siu Pang Tommy Choi picture Siu Pang Tommy Choi · Nov 9, 2018

I don't know Owl Carousel Thumbs, but as what @lucascaro suggested, you just use another carousel for those thumbnails, and add appropriate event handler.

Say #oc1 is your top carousel, and #oc2 is your thumbnail carousel. You could write something like:

$('#oc2 .item').click(function () {
    $('#oc1').trigger('to.owl.carousel', $(this).data('slide'));
});

where data('slide') is some data- attribute, e.g. data-slide="1", you put in each slide of the thumbnail carousel.

Regarding to the left and right nav buttons, you write the buttons in your own HTML and attach the click events like this:

$('.left').click(function () {
    $('#oc2').trigger('prev.owl.carousel');
});
$('.right').click(function () {
    $('#oc2').trigger('next.owl.carousel');
});