owl carousel 2 not work with loop and 1 items (Bug Fixed Now)

Perspolis picture Perspolis · Aug 31, 2015 · Viewed 50.3k times · Source

I work with owl carousel 2 for carousel content.

JS:

$('#owl-demo').owlCarousel({
    loop: true,
    margin: 10,
    nav: true,
    items: 1,
});

HTML:

<div id="owl-demo" class="owl-carousel">
    <div class="item"><h4>1</h4></div>
</div>

Problem:

when I have one content (dynamic content using PHP) loop:true and items:1 not work and I see blank But if I add two content Owl worked true!!

EDIT : my content is dynamic ( 1 - ....). when my result is one content owl have a problem.

Problem DEMO

worked DEMO

how do fix this problem ?

Answer

Perspolis picture Perspolis · Sep 5, 2015

I report this bug to Owl developer group and fix this problem here.

Change this line in Commit

view = Math.max(settings.items * 2, 2),

Now this worked in demo