Search code examples
javascripthtmljqueryowl-carousel

How to fix owl carousel empty spaces after scrolling?


I use the last version of own carousel

I applied this slider on my page

As you can see thre is a horizontal slider with circles. After click next button I get empty spaced on the owl stage.

As solution I tried to set negative right to the stage:

.owl-stage {
  right: -383px;
}

How to fix it?

Screen example


Solution

  • This effect occurs when center option is set as true, but loop option is disabled or set as false. For example:

    $('.owl-carousel').owlCarousel({
        center: true,
        loop:false,
        ...
    });
    

    So There are two ways to avoid this effect:

    1. Set both center and loop to false
    2. Set both center and loop to true