0.0.4 • Published 9 months ago

@solar_tiger/toggle-dropdown-menu v0.0.4

Weekly downloads
-
License
ISC
Repository
github
Last release
9 months ago

A simple way to handle dropdown menus

Whether you have one, two, three or more dropdown menus, this npm package can handle them all!

How to use

This NPM package has one, simple function: toggleDropdownVisibility

It takes the button element as a querySelector/querySelectorAll as the first argument and the class name you have hiding your dropdown container as the second argument

const dropdownBtns = document.querySelectorAll(".dropdown-button")

toggleDropdownVisibility(dropdownBtns, "hidden")

And that's all! Each dropdown you create will hide/reveal itself when you click the button or click anywhere that isn't the container!

0.0.4

9 months ago

0.0.3

10 months ago

0.0.1

10 months ago