Owl Carousel Won't Autoplay

后端 未结 15 1266
失恋的感觉
失恋的感觉 2020-12-01 18:06

I\'m using the Owl Carousel on my site. According to their documentation, this piece of JavaScript should work:



        
15条回答
  •  被撕碎了的回忆
    2020-12-01 18:24

    You should set both autoplay and autoplayTimeout properties. I used this code, and it works for me:

    $('.owl-carousel').owlCarousel({
                    autoplay: true,
                    autoplayTimeout: 5000,
                    navigation: false,
                    margin: 10,
                    responsive: {
                        0: {
                            items: 1
                        },
                        600: {
                            items: 2
                        },
                        1000: {
                            items: 2
                        }
                    }
                })
    

提交回复
热议问题