在点击时使用导航多个幻灯片移动猫头鹰轮播

时间:2017-05-16 13:10:06

标签: javascript jquery carousel owl-carousel

我们有什么方法可以通过点击导航移动猫头鹰轮播中的多个项目。

在演示中像这样

http://www.jqueryscript.net/demo/Powerful-Customizable-jQuery-Carousel-Slider-OWL-Carousel/demos/custom.html

我希望在导航链接中有一个滑动滑块选项,但我想在猫头鹰中使用它。

1 个答案:

答案 0 :(得分:2)

您应该包含slideBy: [number]slideBy: 'page'选项,因为他们会在documentation上对其进行描述。

$('.owl-carousel').owlCarousel({
  margin: 10,
  nav: true,
  items: 5,
  slideBy: 5
})
.item {
  background: red;
  text-align: center;
}
<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>