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

218
Views
El evento de clic no funciona en el primer clic, ¿por qué?

Estoy tratando de hacer un menú de acordeón. Estoy comparando la propiedad de altura para abrir y cerrar el menú. Pero en el primer clic no funciona, funciona bien después del segundo, tercer clic. Para mí, mi algoritmo tenía sentido. Pero a menudo obtengo resultados que no esperaba.

 let portfolio_button = document.getElementById('portfolio--button'); let portfolio_menu = document.getElementById('portfolio--menu'); let i = 0; let mobile_menu = document.getElementById('mobile--menu'); let mobile_menu_icon = document.getElementById('mobile--menu--icon'); function portfolioMenu(){ if(portfolio_menu.style.height === "0px"){ portfolio_menu.style.height = "100px"; mobile_menu.style.height = "370px"; } else{ portfolio_menu.style.height = 0; mobile_menu.style.height = "270px"; } } function openMobileMenu() { if (mobile_menu.style.height === "
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!