Owl Carousel Will Not Autoplay

前端 未结 7 1309
梦谈多话
梦谈多话 2020-12-21 09:37

I\'m building a wordpress site with a JQuery carousel using the Owl Carousel 2 JQuery plugin. I\'ve used this carousel before with success, but I\'m stumped on this one and

相关标签:
7条回答
  • 2020-12-21 09:59

    Figured it out. Wow, can't believe I missed that. Had to include the autoplay.js in the section

    <script src="owl/js/owl.autoplay.js"></script>
    
    0 讨论(0)
  • 2020-12-21 10:04

    I also faced a similar issue. Then I searched and found a solution that the autoplay should be re-corrected as autoPlay with p as capital. And it worked for me.

    0 讨论(0)
  • 2020-12-21 10:07

    This is what you need to do, when you call the owl-demo / owl-carousel you need to add
    | autoPlay: 3000 | (----- 3000 = 3sec rotation between images.
    You don't need to touch anything else.

    $(document).ready(function() {
    
      var owl = $("#owl-demo");
    
      owl.owlCarousel({
        navigation : false,
        singleItem : true,
        autoPlay: 3000,
        transitionStyle : "fadeUp"
    
      });
    
    });
    
    0 讨论(0)
  • 2020-12-21 10:09
    $(document).ready(function() {
    
          var owl = $('.owl-carousel');
            owl.owlCarousel({
                items:4,
                margin:10,
                autoPlay: 3000,
                autoplaySpeed:2000  
            });
    });
    
    0 讨论(0)
  • 2020-12-21 10:10

    It's stupid solution but maybe somebody can face with it.

    I've worked in others code, so he call owlCarousel() with "autoPlay: false", in one of included javascript files. I called it after he call owlCarousel() function with "autoPlay: true". But it's not worked and also browser don't give any notification inn console if it's calling twice the same function.

    0 讨论(0)
  • 2020-12-21 10:11
    owl.owlCarousel({
            items:4,
            nav:true,
            loop:true,
            autoWidth:true,
            itemsTablet: [768,1]
        });
    
    1. First, you need to call the owl.autoplay.js.

    2. This code works for me:

      owl.trigger('play.owl.autoplay',[1000]); 
      
    0 讨论(0)
提交回复
热议问题