【发布时间】:2019-03-18 08:39:39
【问题描述】:
我正在使用一个名为 Owl Carousel 2 的滑块插件。
我也在使用Animate.css。
现在我的问题是 animateIn: 'slideInLeft' 正在工作,但 animateOut 没有根据我的需要工作。
我需要像这样滑动图片:
https://www.w3schools.com/booTsTrap/tryit.asp?filename=trybs_carousel2&stacked=h
注意:它是从右向左滑动,但我需要它反向滑动(从左向右)。
你能帮我解决这个问题吗?
$('#GallerySlider').owlCarousel({
dots: false,
loop: true,
margin: 10,
nav: true,
autoplay: true,
animateIn: 'slideInLeft',
animateOut: 'slideInLeft',
responsive: {
0: {
items: 1
},
600: {
items: 1
},
1000: {
items: 1
}
}
});
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.7.0/animate.min.css">
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/assets/owl.carousel.min.css">
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/assets/owl.theme.default.min.css">
<section>
<div class="Gallery">
<div class="owl-carousel owl-theme" id="GallerySlider">
<div class="item"><img src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTlkGqPJPf0tsgfoEVS32fPXDJRQ2mxk5ioOnFhrgDsCKnSpPve"></div>
<div class="item"><img src="https://images.unsplash.com/photo-1486406146926-c627a92ad1ab?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&w=1000&q=80"></div>
<div class="item"><img src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTvmsPDO1qCfjUNpAKgj5uBfuuDohdAMa1BTIeHGn-FmN6A3lOu"></div>
</div>
</div>
</section>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/owl.carousel.min.js"></script>
【问题讨论】:
-
感谢您的编辑。 @杰克
标签: javascript jquery html css owl-carousel