rdtowe
rdtowe

Reputation: 13

Needing to slide by 7 slides on Prev-Next

I am creating a custom calendar slider using Owl Carousel. It will show 7 days a a time (so 7 slides are active). When I click on the pagination dots, the slides move by 7 slides. However, when using custom Prev-Next buttons, it only moves one slide at a time.

My custom buttons are calling the following:

$('.calNextButton').click(function() {
   $('.owl-carousel').trigger('next.owl.carousel');
});

$('.calPrevButton').click(function() {
    $('.owl-carousel').trigger('prev.owl.carousel');
});

Is there a way to customize these functions to move by a specific number of slides, instead of just one at a time?

I am using Owl Carousel v2.2.1. I am attaching a screen shot of my calendar slider for your reference. Screen Capture of Calendar Slider

Upvotes: 1

Views: 512

Answers (1)

taymyinl
taymyinl

Reputation: 295

Try to use slideBy option

    $('.owl-carousel').owlCarousel({
        slideBy: 7,
    });

For more information https://owlcarousel2.github.io/OwlCarousel2/docs/api-options.html

Upvotes: 1

Related Questions