Open one dropdown at a time
var nav = document.querySelector('.my-nav');
nav.addEventListener('toggle', function (event) {
// Do stuff...
}, true);
Open one dropdown at a time
var nav = document.querySelector('.my-nav');
nav.addEventListener('toggle', function (event) {
// Do stuff...
}, true);
Open one dropdown at a time
var nav = document.querySelector('.my-nav');
nav.addEventListener('toggle', function (event) {
// Only run if the dropdown is open
if (!event.target.open) return;
// Get all other open dropdowns and close them
var dropdowns = nav.querySelectorAll('.dropdown[open]');
Array.prototype.forEach.call(dropdowns, function (dropdown) {
if (dropdown === event.target) return;
dropdown.removeAttribute('open');
});
}, true);
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us