gpt4 book ai didi

jquery - Owl Carousel 2 淡入淡出效果不起作用

转载 作者:行者123 更新时间:2023-12-01 03:09:04 24 4
gpt4 key购买 nike

我目前正在尝试使用具有淡入淡出效果的 owl carousel 2,但它显示已安装的默认滑动效果。我该如何修复它。

这是我的代码

  function owlWrapperWidth( selector ) {
$(selector).each(function(){
$(this).find('.owl-carousel').outerWidth( $(this).closest( selector ).innerWidth() );
});
}

owlWrapperWidth( '.owl-wrapper' );
$( window ).resize(function() {
owlWrapperWidth( $('.owl-wrapper') );
});

$('.owl-carousel').owlCarousel({animateOut: '淡出',

    animateIn: 'fadeIn',
nav:true,





loop: true,
responsive: {
0: {
items: 1
},
600: {
items: 2
},
1000: {
items: 3,
slideBy:3,
}
}
});

我添加了 animateIn:'fadeIn' 但没有成功

谢谢

最佳答案

Owl 动画函数仅适用于“单项”轮播(一次仅显示一张幻灯片):

“Animate 函数仅适用于一项,并且仅适用于支持透视属性的浏览器。”

请参阅此处:http://owlcarousel2.github.io/OwlCarousel2/demos/animate.html

这是我当前的 slider 实现之一,相应地使用了 fadeIn 和 fadeOut,从所有方面来看,您的代码对于核心 owl 来说看起来都是正确的,而且效果很好。

$('.index-gallery .owlcarousel').owlCarousel({
themeClass: 'owl-fullscreen owl-nonav white owl-loaded',
autoplay:true,
autoplayTimeout: 4000,
items:1, // items to display in slider
//margin:0, // margin(px) on item.
//LOOP? - IF ONLY ONE SLIDE SEE: https://github.com/smashingboxes/OwlCarousel2/issues/548
loop:true, // Inifnity loop. Duplicate last and first items to get loop illusion.
navRewind:true, // Go to first/last.
nav:true, // left and right arrows
autoHeight: true,
navContainerClass: 'owl-buttons',
dotsClass: 'owl-pagination',
dotClass: 'owl-page',
animateOut: 'fadeOut',
animateIn: 'fadeIn',
autoplayHoverPause:true, //false
lazyLoad: false, // IMG need special markup class="lazyOwl" and data-src="url_to_img" or/and data-src-retina="url_to_highres_img"
dots:false // true
});

您可能希望查看此帖子以获取进一步的建议/解决方案/想法:

Owl Carousel fade effect not working

关于jquery - Owl Carousel 2 淡入淡出效果不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37583872/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com