Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Owl Carousel 2 resize window bug

I decided to make a slider on Owl Carousel 2. Everything works fine, I like it, but I've noticed a bug. When I change the size of the browser window (only Chrome), the slider items are rearranged and there is a phantom item on 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 it?

[Codepen]

like image 431
Ihor Tkachuk Avatar asked Nov 03 '15 08:11

Ihor Tkachuk


1 Answers

Try this

.owl-carousel .owl-item img {
  -webkit-backface-visibility: hidden;
}
like image 70
Nenad Vracar Avatar answered Oct 23 '22 23:10

Nenad Vracar