如何在 Owl Carrousel 中放置箭头?
How to put arrows in Owl Carrousel?
有没有办法通过js或html+css将导航箭头放入owl轮播中?它工作正常,但我认为你必须拖动图像才能导航不太好,因此箭头可以为我解决这个问题。我通过互联网找到了一些答案,但其中 none 对我有用,当我在 js 上修改某些内容时,carrousel 停止工作。
<div class="owl-carousel owl-theme" >
<div class="item itemmb">
<img class="img-fluid img-card" src="Imagens/dent.jpg">
<h4 class="h4 text-center my-3"> Test </h4>
<h4 class="p text-center my-3 sb-m saiba-mais"> Test </h4>
</div>
<div class="item">
<img class="img-fluid img-card" src="Imagens/ped.jpg">
<h4 class="h4 text-center my-3"> Test </h4>
<h4 class="h4 text-center my-3 sb-m saiba-mais"> Test </h4>
</div>
<div class="item">
<img class="img-fluid img-card" src="Imagens/ped.jpg">
<h4 class="h4 text-center my-3"> Test </h4>
<h4 class="h4 text-center my-3 sb-m saiba-mais"> Test </h4>
</div>
<script type="text/javascript">
$('.owl-carousel').owlCarousel({
loop:true,
navigation: true,
margin:20,
nav:true,
responsive:
{
0:{
items:1
},
600:{
items:3
},
1000:{
items:5
}
}
})
</script>
因为响应式initialization.If你没有足够items
不会有任何箭头或点显示
$('.owl-carousel').owlCarousel({
loop: true,
margin: 20,
nav: true,
responsive:
{
0: {
items: 1
},
600: {
items: 1
},
1000: {
items: 1
}
}
})
<link href="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/assets/owl.carousel.css" rel="stylesheet" />
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/owl.carousel.min.js"></script>
<div class="owl-carousel owl-theme">
<div class=" itemmb">
<img class="img-fluid img-card" src="http://www.windmillsonline.co.uk/wp-content/uploads/2013/03/img-banner-thefoundation.jpg">
<h4 class="h4 text-center my-3"> Test </h4>
<h4 class="p text-center my-3 sb-m saiba-mais"> Test </h4>
</div>
<div class="">
<img class="img-fluid img-card" src="http://www.windmillsonline.co.uk/wp-content/uploads/2013/03/img-banner-thefoundation.jpg">
<h4 class="h4 text-center my-3"> Test </h4>
<h4 class="h4 text-center my-3 sb-m saiba-mais"> Test </h4>
</div>
<div class="">
<img class="img-fluid img-card" src="http://www.windmillsonline.co.uk/wp-content/uploads/2013/03/img-banner-thefoundation.jpg">
<h4 class="h4 text-center my-3"> Test </h4>
<h4 class="h4 text-center my-3 sb-m saiba-mais"> Test </h4>
</div>
</div>
有没有办法通过js或html+css将导航箭头放入owl轮播中?它工作正常,但我认为你必须拖动图像才能导航不太好,因此箭头可以为我解决这个问题。我通过互联网找到了一些答案,但其中 none 对我有用,当我在 js 上修改某些内容时,carrousel 停止工作。
<div class="owl-carousel owl-theme" >
<div class="item itemmb">
<img class="img-fluid img-card" src="Imagens/dent.jpg">
<h4 class="h4 text-center my-3"> Test </h4>
<h4 class="p text-center my-3 sb-m saiba-mais"> Test </h4>
</div>
<div class="item">
<img class="img-fluid img-card" src="Imagens/ped.jpg">
<h4 class="h4 text-center my-3"> Test </h4>
<h4 class="h4 text-center my-3 sb-m saiba-mais"> Test </h4>
</div>
<div class="item">
<img class="img-fluid img-card" src="Imagens/ped.jpg">
<h4 class="h4 text-center my-3"> Test </h4>
<h4 class="h4 text-center my-3 sb-m saiba-mais"> Test </h4>
</div>
<script type="text/javascript">
$('.owl-carousel').owlCarousel({
loop:true,
navigation: true,
margin:20,
nav:true,
responsive:
{
0:{
items:1
},
600:{
items:3
},
1000:{
items:5
}
}
})
</script>
因为响应式initialization.If你没有足够items
不会有任何箭头或点显示
$('.owl-carousel').owlCarousel({
loop: true,
margin: 20,
nav: true,
responsive:
{
0: {
items: 1
},
600: {
items: 1
},
1000: {
items: 1
}
}
})
<link href="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/assets/owl.carousel.css" rel="stylesheet" />
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/owl.carousel.min.js"></script>
<div class="owl-carousel owl-theme">
<div class=" itemmb">
<img class="img-fluid img-card" src="http://www.windmillsonline.co.uk/wp-content/uploads/2013/03/img-banner-thefoundation.jpg">
<h4 class="h4 text-center my-3"> Test </h4>
<h4 class="p text-center my-3 sb-m saiba-mais"> Test </h4>
</div>
<div class="">
<img class="img-fluid img-card" src="http://www.windmillsonline.co.uk/wp-content/uploads/2013/03/img-banner-thefoundation.jpg">
<h4 class="h4 text-center my-3"> Test </h4>
<h4 class="h4 text-center my-3 sb-m saiba-mais"> Test </h4>
</div>
<div class="">
<img class="img-fluid img-card" src="http://www.windmillsonline.co.uk/wp-content/uploads/2013/03/img-banner-thefoundation.jpg">
<h4 class="h4 text-center my-3"> Test </h4>
<h4 class="h4 text-center my-3 sb-m saiba-mais"> Test </h4>
</div>
</div>