昨天我向一位客户展示了一个网站。我总是使用 Owl carousel,因为它是响应式的。客户却嫌弃前后两个字,想改成箭头。
因此我更新了我的脚本。 .js 文件。这很容易做到,我想分享它。
$(document).ready(function(){
$('.owl-carousel').owlCarousel({
nav:true,
responsive:{
...
})
$( ".owl-prev").html('<i class="fa fa-chevron-left"></i>');
$( ".owl-next").html('<i class="fa fa-chevron-right"></i>');
});
好吧,你有它。您可以随时添加更多样式。 (我第一次使用你自己的问题的答案希望这是正确的地方/方式)
最佳答案
如果您使用的是 Owl Carousel 2
,那么您应该使用以下内容:
$(".category-wrapper").owlCarousel({
items : 4,
loop : true,
margin : 30,
nav : true,
smartSpeed :900,
navText : ["<i class='fa fa-chevron-left'></i>","<i class='fa fa-chevron-right'></i>"]
});
关于javascript - 如何制作带有箭头而不是下一个上一个的猫头鹰旋转木马,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58148409/