0

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

Learning
  • 19,469
  • 39
  • 180
  • 373

1 Answers1

2

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
    });
PPL
  • 6,357
  • 1
  • 11
  • 30