A simple menu, usually taken from some existing library, but I have built it from scratch using only vanilla JavaScript, HTML and CSS.
Features:
- opens when clicking on the element
- menu-item color change on hover - color stays changed when the item is selected (menu open)
- switches between the submenus
- second click on the currently opened item closes the menu
- "Esc" and a click outside the menu closes the entire menu
- responsive - from 500px changes to hamburger with the same functionality for submenus
The menus should be added as:
with level-2 subitems (which need to be linked to the respective targets).