Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

115
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!