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

208
Vistas
Change from click to reveal to keyup (bonus if I can designate a specific key)

Current script is:

<script data-name="Incremental IO" data-version="v0.1">
    var observer = new MutationObserver((mutations) => {
        mutations.forEach((mutation) => {
            if (!mutation.addedNodes) return
            if ((rect = document.querySelector(".closet-rect")) != null) {
                incrementalIO(rect)
                observer.disconnect()
            }
        })
    })
    observer.observe(document.getElementById("qa"), {
        childList: true,
        subtree: true
    })
    function incrementalIO(first) {
        for (rect of document.querySelectorAll(".closet-rect.is-active")) {
            rect.classList.remove("is-active")
        }
       activate(first)
    }
    function activate(rect) {
        rect.classList.add("is-active")
        rect.addEventListener("click", reveal)
    }
    function reveal() {
        this.classList.remove("is-front")
        this.classList.add("is-back")
        if ((next = this.nextElementSibling) != null) {
            activate(next)
        }
    }
</script>

When I change the .addEventListener to "keyup", I still have to click on the object before it allows the keyup function to work. This defeats the purpose of removing the click to reveal. Is there a way that I can automatically have the object(s) selected for the keyup to work? Ideally, I would like to specify one key to do this, but I'd settle for any at the moment.

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