猫头鹰轮播幻灯片n到n [英] owl carousel slide n by n

查看:84
本文介绍了猫头鹰轮播幻灯片n到n的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 猫头鹰传送带 ,并尝试将项目逐五滑动,现在我有5个项目,我想当我按下一个"或上一个"按钮时,它移到下一个5个项目,当前它移到下一个项目,有可能吗?

Using owl carousel and trying to slide items five by five, now i have 5 items, i want when i push next or prev button it move to next five item, currently it move to next item, is it possible?

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

演示

我通过Google搜索并检查了插件网站,但找不到任何内容.

i googled and checked plugin website but couldn't find anything.

推荐答案

使用

Use the slideBy options in the owlCarousel config:

$('.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>

这篇关于猫头鹰轮播幻灯片n到n的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆