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

116
Visualizações
Bootstrap Carousel Add Method next when visible

i have a carousel from bootstrap all setup - now i want it not to change when not visible, because i have different aspect ratio pictures in it so it messes with the body if its not visible. I tried the following code before my body tag:

<script>
    let myCarousel = document.querySelector('#carouselExampleFade')
    console.log(myCarousel)
    let carousel = bootstrap.Carousel.getInstance(myCarousel)
    console.log(carousel)
    carousel.nextWhenVisible()
    console.log("Next when visible")

</script>

the first log shows that js gets my carousel correctly. however, on the second log it says that its "null", and therefore cant apply nextwhenvisible. I use Bootstrap 5.

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