SiteWebAstrolabe/src/js/components/menu-toggle.js

13 lines
545 B
JavaScript
Raw Normal View History

2020-07-17 23:33:46 +02:00
function menuToggle(elm) {
2020-07-17 19:59:41 +02:00
var menu = document.getElementById('menu');
menu.classList.toggle('show');
2020-07-17 23:33:46 +02:00
if (menu.classList.contains('show')) {
elm.querySelector('#icon-show').style.display = 'none';
elm.querySelector('#icon-close').style.display = 'inline';
2020-07-19 22:55:29 +02:00
elm.querySelector('.menu-toggle__label').textContent = 'fermer';
2020-07-17 23:33:46 +02:00
} else {
elm.querySelector('#icon-show').style.display = 'inline';
elm.querySelector('#icon-close').style.display = 'none';
2020-07-19 22:55:29 +02:00
elm.querySelector('.menu-toggle__label').textContent = 'menu';
2020-07-17 23:33:46 +02:00
}
2020-07-17 19:59:41 +02:00
}