A javascript library for create drop down menu in your app.
- Create Drop Down Menu
- Nestable(No Limit)
<script src="path/to/dist/index.min.js"></script>
<script src="https://unpkg.com/html-dropdown-menu/dist/index.min.js"><script>
<link rel="stylesheet" href="path/to/dist/style.css">
<link rel="stylesheet" href="https://unpkg.com/html-dropdown-menu/dist/dropdown.css">
createDropDownMenu(appendTo,content)
The Menu will be appended to the element.
[
DropdownListCategory1,
DropdownListCategory2,
DropdownListCategory3,
...
]
{
name:string,
content: Array<DropDownMenuListLabel>
}
{
text:string;
onclick?:Function;
children?: Array<DropDownMenuListLabel>
}
If the menu label has any children,onclick will be not executed.
[
{
name: "File",
content: [
{
text: "New Instance",
onclick:()=>window.open("url")
},
{
text: "Open File",
onclick:()=>...;
},
{
text: "New Folder",
onclick:()=>...;
},
{
text: "Recent Opened",
children: [
{
text: "path/to/file",
onclick:()=>...;
}
]
}
]
}
]