1.0.5 • Published 2 years ago

ofm-dropdown v1.0.5

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

Dropdown

A small script for priming dropdown menus. The dropdown function expects two identifiers for the dropdown button and the associated menu. Those identifiers are expected to be classes and the relationship between the button and the identifier is expected to be that of siblings. The dropdown() function will then listen for clicks on the document and append the class active-dropdown to the dropdown menu if the click is on the button.

eg

<div>
  <a class="expandable">
  <div class="dropdown-menu">
    <a href="#" class="link">2021</a>
    <a href="#" class="link">2022</a>
  </div>
</div>

Calling the function

import dropdown from "ofm-dropdown";

dropdown("expandable","dropdown-menu");

Demo

demo

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago