Owl Carousel 2 resizes window

I decided to make a slider on Owl Carousel 2. Everything works fine, I like it, but I noticed an error. When I resize the browser window (Chrome only), the slider elements are reordered and there is a phantom element on the back side.

HTML:

<div class="owl-carousel">
    <img src="http://placehold.it/320x240?text=Slide%200">
    <img src="http://placehold.it/320x240?text=Slide%201">
    <img src="http://placehold.it/320x240?text=Slide%202">
    <img src="http://placehold.it/320x240?text=Slide%203">
</div>

Script:

$(".owl-carousel").owlCarousel({
    loop: true,
    margin: 20,
    items: 3,
    nav: true,
});

Screenshot:

enter image description here

How can i fix this?

[ Codepen ]

+4
source share
1 answer

try it

.owl-carousel .owl-item img {
  -webkit-backface-visibility: hidden;
}
+9
source

Source: https://habr.com/ru/post/1614236/


All Articles