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

257
Visualizações
Owl Carousel - Navigation Buttons move all sliders in the page

I have multiple Owl Carouse sliders in a page. The problem is that when I use the control button from one slider it moves all the sliders in the page.

I initialize the sliders based on a unique id using this function

function property_slider_v2(slider_id){   
    console.log('we do '+slider_id);
    jQuery('#'+slider_id).owlCarousel({
        loop:true,
        margin:0,
        nav:true,
        items:6,
        dots:false,
        mouseDrag:true,
        video:true,
        autoHeight: true,
        autoWidth:true,
        stagePadding:0,
       // rtl:true,
        navText : [
            '<i class="fas fa-arrow-left"></i>',
            '<i class="fas fa-arrow-right"></i>'
        ],
    });
  
}

the html markup looks like this (page is in php)

$slider_id='property_slider_carousel_elementor_v2_'.rand(1,99999);
.....
<div class="owl-carousel owl-theme " id="'.$slider_id.'" data-auto="">
......
</div>

print'<script type="text/javascript">
    //<![CDATA[
      jQuery(document).ready(function(){
        property_slider_v2("'.$slider_id.'");
      });
    //]]>
</script>';

Beside the "one button controls all" issue all the sliders works as they should.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

So problem in the hashListener function in the OwlCarousel plugin. When you create your html and you don't need hash navigation - dont put attributes data-hash="..." to your html markup for carousel items.

about 4 years ago · Juan Pablo Isaza Relatório
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