Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

174
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda