$(".row2-sliderLT").owlCarousel({
slideSpeed: 600,
paginationSpeed: 600,
singleItem: true,
autoHeight: true
});
$(".row2-sliderRT").owlCarousel({
slideSpeed: 600,
paginationSpeed: 600,
singleItem: true,
autoHeight: true
});
这将创建2个猫头鹰轮播滑块,每个滑块有2个自己的分页,现在我们可以使用第一个滑块创建的分页对于两个sldiers吗?
答案 0 :(得分:0)
我有同样的问题,我用owl2 evens制作了它:
演示:here
<强> HTML:强>
<ul id="ul1" class="owl-carousel owl-theme">
<li>1</li>
<li>2</li>
<li>n..</li>
</ul>
<ul id="ul2" class="owl-carousel owl-theme">
<li>1</li>
<li>2</li>
<li>n..</li>
</ul>
<强> CSS:强>
ul {
padding: 0;
}
ul li {
list-style: none;
margin: 20px;
padding: 20px;
text-align: center;
line-height: 50px;
background-color: #ddd;
}
JS(jQuery):
$('#ul1').owlCarousel({
items: 1,
}).on('changed.owl.carousel', function (e) {
console.log('ul2.trigger.to ' + e.item.index);
$('#ul2').trigger('to.owl.carousel', e.item.index);
});
$('#ul2').owlCarousel({
items: 3,
dots: false,
}).on('changed.owl.carousel', function (e) {
console.log('ul1.trigger.to ' + e.item.index);
$('#ul1').trigger('to.owl.carousel', e.item.index);
});