Owl Carousal auto refresh even when single image is there singleItem mode

I am using owl.carousal version 1.3.3 and i am using single item for showing i auto show image after 5000ms.

var owl = $("#widget-slider");
    owl.owlCarousel({
        autoPlay: 5000, //Set AutoPlay to 5 seconds
        navigation: false,
        singleItem: true,
        transitionStyle: "fade"
    });

All this works fine except when i have only one image to show in carousal at that time Carousal auto-refreshes which is annoying user.

How can i stop oql from auto refreshing when there is only 1 image

Code pen example https://codepen.io/anon/pen/GdXzwd

1 answer

  • answered 2018-05-16 06:47 PPL

    Try below code and check

    var owl = $("#widget-slider");
        owl.owlCarousel({
            autoPlay: 5000, //Set AutoPlay to 5 seconds
            navigation: false,
            singleItem: true,
            transitionStyle: "fade",
            autoPlay: $("#widget-slider > div").length > 1 ? 5000 : false
        });