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

144
Visualizações
changeTab Function with jquery

Hi there community i managed to create that code that works as tabs function. Every tab has a collection that change with click on other tab, every collection if has more than 4 products it shows some button like "see all". I need to add that on the function changeTab. Here is the code i create;

tabs = document.querySelectorAll(".featured-products-section__tab");
tabContents = document.querySelectorAll(".featured-products-section__products");
tabViewAll = document.querySelectorAll(".featured-products-section__view-all");

tabs.forEach(function (tab) {
  tab.addEventListener("click", function () {

    contentId = this.dataset.contentId;
    content = document.getElementById(contentId);

    tabContents.forEach(function (content) {
      content.classList.remove("active");
    });

    tabs.forEach(function (tab) {
      tab.classList.remove("active");
    });

    this.classList.add("active");
    content.classList.add("active");
  });
});
.featured-products-section__view-all.active {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    justify-content: center;
}

.featured-products-section__view-all {
    display: none;
}

I create a new var called tabViewAll to get that button, but where i have to add it? i tried some ways but unfortunatly no one worked.

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