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

265
Views
¿Solo mostrar una sección de contenido a la vez sin apilarse sobre sí mismo?

Tengo problemas para mostrar mi contenido solo en una sección de mi barra de navegación a la vez. Actualmente, como puede ver, muestra el contenido activo clothing1 muy bien, pero cuando hago clic en clothing2 quiero que clothing1 se oculte y se muestre el contenido de clothing2 , y así sucesivamente.

No quiero que el contenido se acumule encima de sí mismo si eso tiene sentido.

 document.getElementById('nav_clothing').addEventListener('click', function(){ var secClothing = document.getElementById('sec-clothing'); if( getComputedStyle(secClothing,null).display=='none') secClothing.style.display='block'; else secClothing.style.display='none'; }, false);
 <!-- start of list content --> <ul class="navigation-bar navigation-bar-left"> <li class="active"><a href="#clothing" id="nav_clothing" data-toggle="tab" class="class2">clothing 1</a></li> <li><a href="#clothing2" id="nav_clothing2" class="class2">clothing 2</a></li> <li><a href="#clothing3" id="nav_clothing3" data-toggle="tab" class="class2">clothing 3</a></li> <li><a href="#clothing4" id="nav_clothing4" data-toggle="tab" class="class2">clothing 4</a></li> <li><a href="#clothing5" id="nav_clothing5" data-toggle="tab" class="class2">clothing 5</a></li> </ul> <!-- end of list content --> <!-- content when list expands --> <section id="sec-clothing"> <div class="grid-item"> <h2>Test content </h2> </div> <div class="grid-item"> <img src="test.svg" class="headerbarcode" id="headerbarcode" alt="test image 1"> </div> <div class="grid-item"> <img src="test2.svg" class="headertext" id="headertext" alt="test image 2"> </div> </section> <!-- end of content when list expands -->

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!