Owl carousel - auto width, last item is pulled out from stack

SirInfant picture SirInfant · Jan 9, 2015 · Viewed 8.6k times · Source

i am experiencing strange issue with OWL CAROUSEL 2. I'm creating simple carousel for 12 tables, but when using option "autoWidth", last table is pulled out from carousel stack.

DEMO

If you open fiddle, there is carousel for every month in year. At the end of carousel, there is no December, but if you check source code, you can see that December is there. For some reason OWL carousel plugin is pulling December out.

Any ideas? In advance, many thanks!

Answer

Ishvar Akhaja picture Ishvar Akhaja · Dec 14, 2017

Add just display flex in CSS for .owl-stage class and also add jS function for smaller devices.

CSS

.owl-stage{display:flex}

JS

  $('.owl-carousel').owlCarousel({   
   loop: false,   
   autoWidth:true, 
   margin:10,
   nav:true,
   responsive:{
    0:{
     items:1,
     autoWidth:false 
    },
    768:{
     items:3
    }
   } 
 });