Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

165
Vistas
Tabs effect to show and hide Divi sections

I am trying to do a tab effect to show and hide Divi sections when I click on the button. I found one solution online, but it does only toggle effect. So when I click on one button and then on the second button, the section from the first button stays active and doesn't hide. I want to do a tab effect, so when I click on the first button, first section stays active and when I click on second button, first section disappear and appears only second section. Here is the code that I am using right now:

<style>
body:not(.et-fb) .rv_element { display: none; }
.et_pb_button.rv_button_opened:after { content:"\32"; }
.et_pb_button.rv_button_closed:after { content:"\33"; }

.rv_element_2 { 
    display: none; 
}
</style>

<script>
jQuery(function($){
    var revealButtons = {
        '.rv_button_1': '.rv_element_1',
        '.rv_button_2': '.rv_element_2'
    };
    $.each(revealButtons, function(revealButton, revealElement, hideElement) {
        $(revealButton).click(function(e){
            e.preventDefault();
            $(revealElement).slideToggle();
            $(revealButton).toggleClass('rv_button_opened rv_button_closed');
        });
    });
});
jQuery(function($){
    $('.rv_button_1').click();
});
</script> 

rv_element_1-2 are sections that I want to show/hide and rv_button_1-2 are buttons I am clicking. Currently, I make the first section appear automatically with a click function on the first button.

I believe there is some simple solution for this, but I am new to JS and jQuery and it is difficult for me to figure it out by myself.

Thanks a lot for your help.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Hi how are you ? I think I have something with Divi that can help you. I don't know if you managed to solve it

almost 4 years ago · Anibal Fernandez Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda