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

133
Views
Hide individual slide in Bootstrap Carousel on click

I am looking to hide one Bootstrap carousel item and display it again when a button is clicked. I am using Jquery's .detach method which hides the slide, however when I try to append the hidden slide back, the slide does not appear in the same spot.

For example, I have CarouselItem1, CarouselItem2, CarouselItem3. I click on a button which hides CarouselItem2. When I click on another button I want CarouselItem2 to reappear in the same spot between CarouselItem1 and CarouselItem2

$("#customSwitch2").change(function(event){
    if (this.checked){
        var copy = $('#slide2');
        $('#slide2').detach(); <- this works
        
    } else {
        $('#slide1').append(copy);
    }
});
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!