Owl-carousel Autoplay无法正常工作

时间:2015-07-06 12:22:02

标签: jquery owl-carousel

我对此进行了大量搜索,并且每次都找到了几乎相同的答案。我已经提到了Owl Carousel Won't AutoplayOwl Carousel Will Not Autoplay这也是http://owlcarousel.owlgraphic.com/demos/autoplay.html

我使用下面的代码来设置自动播放时间,但它不起作用:

<script type="text/javascript">
        $(document).ready(function() {
          var owl = $("#productslider");
        owl.owlCarousel({
        items: 1,
        autoplay: true
    });
       });
    </script>

我正在使用以下格式的猫头鹰旋转木马:

<div id="productslider" class="owl-carousel owl-theme">
                <div class="item">
                    <div class="product">
                        <a class="add-fav tooltipHere" data-toggle="tooltip" data-original-title="Add to Wishlist" data-placement="left">
                            <i class="glyphicon glyphicon-heart"></i>
                        </a>
                        <div class="image">
                            <div class="quickview">
                                <a title="Quick View" class="btn btn-xs  btn-quickview" data-target="#product-details-modal" data-toggle="modal"> Quick View </a>
                            </div><a href="product-details.html"><img src="images/product/34.jpg" alt="img" class="img-responsive"></a>
                            <div class="promotion"> <span class="new-product"> NEW</span> <span class="discount">15% OFF</span> </div>
                        </div>
                        <div class="description">
                            <h4><a href="product-details.html">Product 1</a></h4>
                            <p>abcd</p>
                            <span class="size">XL / XXL / S </span> </div>
                        <div class="price"> <span>$25</span> </div>
                        <div class="action-control"> <a class="btn btn-primary"> <span class="add2cart"><i class="glyphicon glyphicon-shopping-cart"> </i> Add to cart </span> </a> </div>
                    </div>
</div>

任何人都可以告诉我,我错过了什么?

2 个答案:

答案 0 :(得分:0)

不确定这是否解决了您的问题,但您可以设置自动播放:500。

autoPlayTimeout似乎不是有效的属性 - http://owlgraphic.com/owlcarousel/#customizing

此外,autoplayHoverPause应该是stopOnHover

答案 1 :(得分:0)

.owlCarousel({     
  autoplay:true,
  autoplayTimeout:2000,
  ...
  ...