我需要添加按钮“查看全部”但是如何制作?
现在它只是一个轮播代码:
$('.owl-carousel').owlCarousel({
loop: true,
nav: true,
items: 9,
});
答案 0 :(得分:1)
<强> DEMO 强>
$('.owl-carousel').owlCarousel({
loop: true,
nav: true,
items: 9,
});
$(".owl-nav").append('<div class="owl-show-all" style="">Show All</div>');
$("body").on("click",".owl-show-all",function(){
alert('here comes yout show all logic');
});
答案 1 :(得分:0)
<强> JS:强>
$(".owl-show-all").click(function () {
$("#owl-example").toggleClass("show_all");
});
<强> CSS:强>
.show_all .owl-stage {
width:980px !important;
-webkit-transform: translate3d(0, 0px, 0px) !important;
}
.owl-stage {
transition: 0.7s !important;
-webkit-transition: 0.7s !important;
}
.owl-item.cloned {display: none;}