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

143
Vistas
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 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