幻灯片之间的淡入淡出过渡需要在owlcarousel上减慢

时间:2017-07-12 17:22:46

标签: javascript jquery owl-carousel

我正在使用owlcarousel2,幻灯片之间的淡入淡出转换仍然太快。当一个图像变为下一个图像时,它需要更慢。 (我不是指单张幻灯片显示多长时间,只是指转换速度)。我有这个选项的地方

autoplaySpeed: 13000,
autoplayTimeout:5000

1 个答案:

答案 0 :(得分:0)

如果您将自动播放缩小为例如2000,它应该播放得更快(反之亦然,如果你想要它更慢,将自动播放速度从13000增加到例如20000,但此刻它似乎是转换的5000,所以增加到也许8000 - 8secs)

查看我的fiddle here(它不同,但它是猫头鹰旋转木马)

$(document).ready(function () {
    $("#owl-demo").owlCarousel({
        autoPlay:2000, //Set AutoPlay to 2 seconds
        dots: true,
        items: 2,
        itemsDesktop: [100, 3],
        itemsDesktopSmall: [200, 3]
    });
});
#owl-demo .item {
    margin: 3px;
}
#owl-demo .item img {
    display: block;
    width: 25%;
    height: auto;
}
.owl-theme .owl-controls .owl-page {
    display: inline-block;
}
.owl-theme .owl-controls .owl-page span {
    background: none repeat scroll 0 0 #869791;
    border-radius: 20px;
    display: block;
    height: 12px;
    margin: 5px 7px;
    opacity: 0.5;
    width: 12px;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/owl-carousel/1.3.2/owl.carousel.min.js"></script>
<link href="http://cdnjs.cloudflare.com/ajax/libs/owl-carousel/1.3.2/owl.carousel.min.css" rel="stylesheet" />


<div id="owl-demo">
  <div class="item">
    <img src="http://placehold.it/50x50" alt="Owl Image" />
  </div>
  <div class="item">
    <img src="http://placehold.it/50x50" alt="Owl Image" />
  </div>
  <div class="item">
    <img src="http://placehold.it/50x50" alt="Owl Image" />
  </div>
  <div class="item">
    <img src="http://placehold.it/50x50" alt="Owl Image" />
  </div>
  <div class="item">
    <img src="http://placehold.it/50x50" alt="Owl Image" />
  </div>
  <div class="item">
    <img src="http://placehold.it/50x50" alt="Owl Image" />
  </div>
  <div class="item">
    <img src="http://placehold.it/50x50" alt="Owl Image" />
  </div>
  <div class="item">
    <img src="http://placehold.it/50x50" alt="Owl Image" />
  </div>
</div>

(片段以某种方式不起作用,但小提琴起作用,如果发现错误,则更正片段,thx)