Skip to content Skip to sidebar Skip to footer

Owl Carousel Slide N By N

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

Solution 1:

Use the slideBy options in the owlCarousel config:

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

Solution 2:

You should include slideBy: 5 or slideBy: 'page' option, as they describe it on their documentation.

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

Post a Comment for "Owl Carousel Slide N By N"