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

105
Vistas
Conditional onkeyup event

Currently I'm using the following:

document.onkeyup = function (data) {
    if (data.key == 'Escape') {
        ClosePlayerMenu()
    }
};

However I'm having two separate menus. A PlayerMenu for normal users, and a Staff menu for Staff members. Everything works but I can't use the current code twice, one to close the Player Menu and one to close the Staff menu as it makes one of the two menus no longer close. So I'm trying to make the key conditional that if PlayerMenu is open, ESC will close it, if Staff Menu is open it will close that. What would be the best approach?

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