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

151
Views
Alternar la capacidad de usar la barra espaciadora cuando se presiona enter

Actualmente estoy tratando de hacer que cada vez que haga clic en Entrar, cambie la capacidad de usar la barra espaciadora. De manera predeterminada, se configurará para que no pueda usar la barra espaciadora, pero cuando se presiona la tecla Intro, se alterna y puede usarla. cuando vuelve a hacer clic en él, no puede volver a usarlo.

 let toggleee = "false" document.addEventListener("keypress", function(event) { if (event.keyCode == 13) { if (toggleee = "false") { let toggleee = "true" } else if (toggleee = "true") { let toggleee = "false" } } }); document.addEventListener("keypress", function(event) { if (event.keyCode == 13) { setTimeout(function() { // code to execute after delay if (toggleee = "false") { window.onkeydown = function(e) { return !(e.keyCode == 32); } } else if (toggleee = "true") { return; } }, 500); } })

En lugar de hacer lo que se pretendía hacer, termina haciendo que la barra espaciadora funcione una vez y luego, cuando haces el cambio, nunca vuelve a funcionar. Por favor ayuda se los agradeceria mucho.

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!