dumogu-dropdown-menu
Version:
A simple custom scrollbar plugin
38 lines (30 loc) • 896 B
Markdown
A simple drop-down menu js library. Super lightweight, no more than 5kb after packaging.
[](https://wurencaideli.github.io/dumogu-dropdown-menu/demo.html)
```javascript
npm install dumogu-dropdown-menu
```
```javascript
import { DumoguDropdownMenu } from 'dumogu-dropdown-menu';
const ddInstance = new DumoguDropdownMenu({
content: '<div class="menu-item"> Test </div>',
area: {
start: [0, 0],
end: [10, 10],
width: 10,
height: 10,
},
show: true,
});
ddInstance.dropdownMenuContainerTargetEl.classList.add(
// Add default theme class name
'dumogu-dropdown-menu-theme',
);
/** When the element position changes, manually update the style */
ddInstance.area = ; /** Position of elements */
ddInstance.update();
/** Set whether to display */
ddInstance.show = ; /** true || false */
```