Search code examples
jqueryowl-carousel

How to scroll per page on OwlCarousel2 using navigation?


On previous version, i can use scrollPerPage: true to slide entire page instead of per item. However, when i tried it on OwlCarousel2, it doesn't seem to work. How do i make scrollperpage work on OwlCarousel2?


Solution

  • Owl Carousel version 2 has two params, that can help you. You must set slideBy equal to param items. For ex.:

    jQuery('#carousel').owlCarousel({
     ...
     slideBy: 5,
     items: 5,
     responsive:{
        0:{
            slideBy: 1,
            items: 1
        },
        600:{
            slideBy: 3,
            items: 3
        },
        1000:{
            slideBy: 5,
            items: 5
        }
    }
    });
    

    And if responsive settings has other items number you must add slideBy also that must be equal to items