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!!!!!
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