1.0.0 • Published 7 months ago

add-dropdown-logic v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

Drop-down menus

You know what we’re talking about here. Picture a nav-bar or a button and when you click it the menu slides down nicely. As mentioned previously, you already know everything you need to create this element. Here are some things to keep in mind:

  • You can allow the menu to show up either on click or on hover.
  • You should hard-code the menu items into your HTML but hide/reveal them using JavaScript. You can do this either by adding a class (visible or something) or by manually setting the style in JS.
  • Make sure the code is reusable! You should be able to create multiple drop-downs on a page without repeating the JavaScript code.
  • If you bundle your code into a module you can publish it to npm and then install and use it anytime you like! Nothing like publishing your own modules to make you feel like a pro 😎.

This is a lesson in The Odin Project.

1.0.0

7 months ago