Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

212
Visualizações
OwlCarousel: Centered / Active element not set reliably

I'm using OwlCarousel 2.x with jQuery 3.x with pretty common settings, nothing too fancy, but sometimes the centered element is not reliably set to the .center CSS class.

I stripped down my own code to a minimal working example via JSFiddle: https://jsfiddle.net/5oLrz8d3/

     jQuery(document).ready(function() {
        jQuery('#matching_carousel').owlCarousel({
            stagePadding: 80,
            loop: true,
            margin: 20,
            items: 1,
            center: true,
            nav: false,
            responsive:{
                0:    {stagePadding: 80},
                700:  {stagePadding: 120},
                1200: {stagePadding: 170},
            }
        });
    });

Happens in Chrome (uBlock and stuff disabled) as well as Firefox or on Safari or mobile devices. If you drag/drop (via mouse or via touch on your mobile device), depending on how exactly you drop the element, sometimes the element in the center will not have the "center" css class. I mostly get it for the "carpet" image it seems.

As I'm graying and hiding some details of the non-centered elements via CSS, this obviously is quite buddy for the user. Looks like this:

enter image description here

Any clue what might cause the issue here and how to fix it?

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda