v0.1

ModalsUX
#91 - Hide Popup For Set Duration
Hide a popup for X time when a button is clicked.
Add one attribute and when the esc key is clicked, the element will be set to display none.
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