浏览文章

文章信息

owlCarousel 显示一个半? show half a little part of the second item? 770

代码示例:

// banner 滑块
$(document).ready(function (){
function bannerSlide(){
if($(window).width()<991){
$('.two-banner-carousel').each(function () {
$(this).addClass('owl-carousel owl-theme');
const items = $(this).data('items') || 2;
const sliderOptions = {
loop: false,
rewind: false,
autoplay: false,
autoplayTimeout: 3000,
nav: false,
// center:true,
mouseDrag: true,
touchDrag: true,
navText: ['', ''],
dots: false,
items: 1.4,
// stagePadding: 50,
responsiveRefreshRate: 200,
responsive: {
0: {items: 1},
320: 1,
601: 1,
992: 2,
1441: {items: 2}
}
};
$(this).owlCarousel(sliderOptions);
});
}
}
bannerSlide();
})


原创