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

178
Views
Can the bootstrap accordion control a DIV?

I am wondering if the bootstrap accordion can control a DIV without javascript. I want to achieve this effect: https://testbuttons.bss.design/accordion.html but now I am using:

$('#btn_lesson-1').click(function(){
    $('#lesson-1').show();
    $('#lesson-2').hide();
    $('#lesson-3').hide();
});

$('#btn_lesson-2').click(function(){
    $('#lesson-2').show();
    $('#lesson-1').hide();
    $('#lesson-3').hide();
});

    
$('#btn_lesson-3').click(function(){
    $('#lesson-3').show();
    $('#lesson-1').hide();
    $('#lesson-2').hide();
    
});

But it gets annoying to create code for more lessons.

Or maybe there is some other way to achieve thisņ Maybe some simple CMS?

Thanks!!!!!

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

If you are using bootstrap, the accordion should already be opening and closing elements by default based on the clicked element. See this example: https://getbootstrap.com/docs/4.0/components/collapse/#accordion-example

about 4 years ago · Juan Pablo Isaza Report
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!