Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Slide 2 items in OWL Carousel

I am using an OWL Carousel for my slider.

What I am trying to do is slide 2 items when next previous is clicked.

So its sliding to every second item still showing the second item during the transmission.

I have tried to work it out with CSS but no success.

Here is my basic setup

$("#owl-demo").owlCarousel({

  navigation : true, // Show next and prev buttons
  slideSpeed : 600,
  paginationSpeed : 400,
  singleItem:true,

  // "singleItem:true" is a shortcut for:
  // items : 2 
  // itemsDesktop : false,
  // itemsDesktopSmall : false,
  // itemsTablet: false,
  // itemsMobile : false

});

Any help much appreciated.

Thanks in advance.

like image 901
Dom Avatar asked Jan 10 '14 13:01

Dom


2 Answers

Don't change plugin code, you just need to intialize carousel with slideBy option as mentioned below.

//Initialize Plugin
$(".owl-carousel").owlCarousel(
  {
    slideBy: 4
  }
);
like image 80
Risheekesh Yadav Avatar answered Oct 03 '22 15:10

Risheekesh Yadav


You can easily add

slideBy: 2

https://owlcarousel2.github.io/OwlCarousel2/docs/api-options.html

like image 35
Chami M Avatar answered Oct 03 '22 14:10

Chami M