Search code examples
javascriptjquerycssowl-carouselowl-carousel-2

Is there a way to limit number of images or pages in owl carousel


I am trying to display only 3 pages where each slide contains 4 items(images) to display content with images using owl carousel. Limiting the total number of images to 12( I have 30-40 images in the folder path) or limit the number of pages. The images are stored in a particular folder path and not defined in the HTML file.

To limit the number of images in each page I have used this.I want to limit the number of pages displayed to 3(with 4 images in each) or total number of images to 12.

$("#owl-example").owlCarousel(
{
    items:4,
    navigation: true
});

Solution

  • The way I solved the problem was by limiting the number of slides as done previously using

    $("#owl-example").owlCarousel(
    {
        items:4,
        navigation: true
    });
    

    I looked for the ways to limit the number of pages in owl carousel but the only way i figured was to limit the number of images before displaying item using owl carousel and since I was using XSLT to displayin the images by applying the templates I figured limiting Items(images) while template was being applied. Would love to see if anybody has better way to limit images or pages in owl carousel itself.