猫头鹰转盘滑动N乘N(owl carousel slide n by n)

2019-09-29 21:39发布

使用猫头鹰旋转木马 ,并试图通过五到滑项目五,现在我有5个项目,我想,当我下一次推或上一个按钮,将其移动到下一五项,目前其移动到下一个项目,这可能吗?

$('.owl-carousel').owlCarousel({
    loop:true,
    items:5,
    margin:10,
    nav:true
})

演示

我用Google搜索和检查的插件网站,但无法找到任何东西。

Answer 1:

使用slideBy在选项owlCarousel配置:

 $('.owl-carousel').owlCarousel({ loop:true, items: 5, margin:10, slideBy: 5, // slide 5 items nav:true }) 
 .item { background: red; } 
 <link href="https://owlcarousel2.github.io/OwlCarousel2/assets/css/docs.theme.min.css" rel="stylesheet"/> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <link href="https://owlcarousel2.github.io/OwlCarousel2/assets/owlcarousel/assets/owl.carousel.min.css" rel="stylesheet"/> <link href="https://owlcarousel2.github.io/OwlCarousel2/assets/owlcarousel/assets/owl.theme.default.min.css" rel="stylesheet"/> <script src="https://owlcarousel2.github.io/OwlCarousel2/assets/owlcarousel/owl.carousel.js"></script> <div class="owl-carousel owl-theme"> <div class="item"><h4>1</h4></div> <div class="item"><h4>2</h4></div> <div class="item"><h4>3</h4></div> <div class="item"><h4>4</h4></div> <div class="item"><h4>5</h4></div> <div class="item"><h4>6</h4></div> <div class="item"><h4>7</h4></div> <div class="item"><h4>8</h4></div> <div class="item"><h4>9</h4></div> <div class="item"><h4>10</h4></div> <div class="item"><h4>11</h4></div> <div class="item"><h4>12</h4></div> </div> 



Answer 2:

你应该包括slideBy: 5slideBy: 'page'选项,因为他们描述在他们的文档 。

https://jsfiddle.net/w3ka3vqw/151/



文章来源: owl carousel slide n by n