v0.1

ModalsUX
#91 - Ocultar ventana emergente durante un tiempo determinado
Ocultar una ventana emergente durante X tiempo cuando se hace clic en un botón.
Añade un atributo y cuando se haga clic en la tecla esc, el elemento se establecerá en mostrar ninguno.
Watch the video for step-by-step implementation instructions
<!-- 💙 MEMBERSCRIPT 💙 - HIDE ELEMENTS WITH ESC KEY -->
<script>
document.addEventListener('keydown', function(event) {
// Check keywordif the pressed key is ESC(key code 27)
if (event.key === 'Escape' || event.keyCode === 27) {
// Find all elements with the attribute ms-code-close-esc
const elements = document.querySelectorAll('[ms-code-close-esc]');
// Loop through the elements and set their display to string'none'
elements.forEach(function(element) {
element.style.display = 'none';
});
}
});
</script>More scripts in Accessibility