jQuery 淡入淡出猫头鹰旋转木马效果不起作用

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/33798845/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-26 16:58:19  来源:igfitidea点击:

Fade in and out owl carousel effect not working

jqueryeffectowl-carousel

提问by itnotsopro

    <script>
    $(document).ready(function () {
          $("#owl-demo").owlCarousel({
              navigation: true,
              navigationText: ["", ""],
              slideSpeed: 300,
              paginationSpeed: 400,
              autoPlay: true,
              mouseDrag: true,
              singleItem: true,
              animateIn: 'fadeIn',
              animateOut: 'fadeOut'
          });
      });
    </script>

Above is my owl carousel quote, i want to have the fade in and out effect but it doesnt seems to appear. Instead it appears as sliding effect.

以上是我的猫头鹰旋转木马报价,我想要淡入淡出效果,但似乎没有出现。相反,它显示为滑动效果。

回答by Jai

I don't think there is any option for fade transition:

我认为淡入淡出过渡没有任何选择:

transitionStyle: "fade" // not available in the docs

another option is to use animate.cssin conjunction with it:

另一种选择是animate.css与它结合使用:

$("#owl-demo").owlCarousel({
  navigation: true,
  navigationText: ["", ""],
  slideSpeed: 300,
  paginationSpeed: 400,
  autoPlay: true,
  mouseDrag: true,
  singleItem: true,
  animateIn: 'fadeIn', // add this
  animateOut: 'fadeOut' // and this
});

回答by Benjamin

Interesting would be which version you are using.. Your code example mixes up options from versions 1.3.* and 2.*.

有趣的是您使用的是哪个版本。您的代码示例混合了 1.3.* 和 2.* 版本的选项。

Since version 2.* you need:

从版本 2.* 开始,您需要:

animateIn: 'fadeIn',
animateOut: 'fadeOut',

https://owlcarousel2.github.io/OwlCarousel2/docs/api-options.html

https://owlcarousel2.github.io/OwlCarousel2/docs/api-options.html

In version 1.3.* you need:

在 1.3.* 版本中,您需要:

transitionStyle: "fade"

http://www.landmarkmlp.com/js-plugin/owl.carousel/#customizing

http://www.landmarkmlp.com/js-plugin/owl.carousel/#customizing

回答by Mr. Sen

animateIn: 'fadeIn', animateOut: 'fadeOut',

animateIn: '淡入', animateOut: '淡出',

Will Work version - Owl Carousel v2.2.1

Will Work版 - Owl Carousel v2.2.1