forked from ruangrupa/lumbung.space
make sub-menus toggle-able in mobile navigation drawer
This commit is contained in:
parent
9ca8e5c445
commit
453b26f041
@ -28,6 +28,14 @@
|
|||||||
document.querySelector('#thumb-'+ id).remove();
|
document.querySelector('#thumb-'+ id).remove();
|
||||||
}
|
}
|
||||||
document.querySelector('[aria-label="Previous"]').parentElement.classList.add('previous-page-link')
|
document.querySelector('[aria-label="Previous"]').parentElement.classList.add('previous-page-link')
|
||||||
|
|
||||||
|
// for toggling submenus in mobile navigation drawer
|
||||||
|
let submenuLinks = document.querySelectorAll('.drawer .has-submenu');
|
||||||
|
[...submenuLinks].forEach(function(submenuLink) {
|
||||||
|
submenuLink.addEventListener('click', () => {
|
||||||
|
submenuLink.querySelector('.submenu').classList.toggle('opened')
|
||||||
|
})
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
|
@ -255,7 +255,12 @@ body {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#top-menu .drawer .submenu {
|
#top-menu .drawer .submenu {
|
||||||
visibility: hidden;
|
position: initial;
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#top-menu .drawer .submenu.opened {
|
||||||
|
display: flex;
|
||||||
}
|
}
|
||||||
|
|
||||||
#top-menu .drawer .submenu li {
|
#top-menu .drawer .submenu li {
|
||||||
@ -270,6 +275,9 @@ body {
|
|||||||
.drawer .has-submenu {
|
.drawer .has-submenu {
|
||||||
padding-left: 1em;
|
padding-left: 1em;
|
||||||
margin-left: 5px;
|
margin-left: 5px;
|
||||||
|
color: #333;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -870,6 +878,10 @@ footer a:hover {
|
|||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#top-menu ul.submenu {
|
||||||
|
position: initial;
|
||||||
|
}
|
||||||
|
|
||||||
.drawer ul li {
|
.drawer ul li {
|
||||||
padding: 1em 0;
|
padding: 1em 0;
|
||||||
/* border-bottom: 1px solid #333; */
|
/* border-bottom: 1px solid #333; */
|
||||||
|
Loading…
Reference in New Issue
Block a user