【发布时间】:2015-11-30 13:39:09
【问题描述】:
我在我的页面中使用 Owl carousel 2,并且我希望有像这里这样的舞台填充选项: http://www.owlcarousel.owlgraphic.com/demos/stagepadding.html
这是我的 HTML:
<div class="owl-carousel">
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
</div>
我的CSS:
.item {
background-image: url("myimage.png");
background-repeat: no-repeat;
background-size: contain;
height: 10rem;
}
还有我的 js:
var owloptions = {
stagePadding: 50,
loop:true,
margin:10,
nav: true,
dots: false,
responsive:{
0:{
items:2
},
600:{
items:3
},
1000:{
items:5
}
}
}
$('.owl-carousel').owlCarousel(owloptions);
我的问题是响应式不起作用。它仅适用于重新加载页面,但不适用于调整大小。我想知道css或js是否有问题?提前致谢
【问题讨论】:
标签: javascript jquery css responsive-design owl-carousel