mirror of
https://github.com/scummvm/scummvm-web.git
synced 2026-06-20 05:45:49 +00:00
* Header is no longer fixed to the top * Header is smaller to take less space on small devices * Nav menu now collapse and expand
22 lines
742 B
JavaScript
22 lines
742 B
JavaScript
document.addEventListener('DOMContentLoaded', function() {
|
|
document.querySelector('#nav-trigger').addEventListener('change', function(e) {
|
|
if (this.checked)
|
|
document.querySelector('body').classList.add('no-scroll');
|
|
else
|
|
document.querySelector('body').classList.remove('no-scroll');
|
|
|
|
|
|
});
|
|
|
|
document.querySelectorAll('nav dt').forEach(function(item) {
|
|
item.addEventListener('click', function() {
|
|
this.parentNode.querySelectorAll('dd').forEach(function(dd) {
|
|
if (dd.classList.contains('visible'))
|
|
dd.classList.remove('visible');
|
|
else
|
|
dd.classList.add('visible');
|
|
});
|
|
})
|
|
})
|
|
})
|