Company logo
  • Empleos
  • Bootcamp
  • Acerca de nosotros
  • Para profesionales
    • Inicio
    • Empleos
    • Cursos y retos
    • Preguntas
    • Profesores
    • Bootcamp
  • Para empresas
    • Inicio
    • Nuestro proceso
    • Planes
    • Pruebas
    • Nómina
    • Blog
    • Calculadora

0

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

7 months ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

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

7 months ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar empleo Planes Nuestro proceso Comercial
Legal
Términos y condiciones Política de privacidad
© 2023 PeakU Inc. All Rights Reserved.