Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

142
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!