Simple jQuery animated searchable select menu based on bootstrap framework.
Add [bootmenu.min.js] to your project.
<script src='bootmenu.min.js'></script>
Bootmenu is also available via npm
$ npm install --save bootmenu
$("div").bootmenu({ parameters });
- Bind two select menus on the callback to make a nested one.
<div id="selectMenu"></div>
<div id="selectMenu2"></div>
$("#selectMenu").bootmenu({
callback: function(value1) {
alert(value1);
$("#selectMenu2").bootmenu({
listName: "MenuTwo",
callback: function(value2) {
alert(value2);
}
});
}
});
Array of items to be added to the list. (default: Please add items to the dropdown!
)
var food = new Array('Pizza', 'Meat', 'Melon', 'Chicken', "Lasagna", "Eggs");
$("#selectMenu").bootmenu({ items : food });
The default placeholder text to display. (default: Select here!
)
$("#selectMenu").bootmenu({ defaultText : "Choose your preferences" });
A unique identifier for each select menu, if you're using more than one menu. (default: listOne
)
$("#selectMenu").bootmenu({ listname : "secondmenu" });
The background color of menu and the hover color of the items. (default: #3498DB
and #2C3E50
)
$("#selectMenu").bootmenu({ background : "#000", hoverColor: "#fff" });
The animation effect when clicking the select menu. (default: slideDown
)
Available animations: rotation, slideDown, fade, slideLeft, rotate, fly,
$("#selectMenu").bootmenu({ listAnimation : "rotation" });
Duration of the animation when clicking the menu. (default: 500ms
)
$("#selectMenu").bootmenu({ listAnimation : "fly", animationDuration: 1000 });
$("#selectMenu").bootmenu({
callback: function(selectedValue)
{
// do something
}
});
Bootmenu © 2016-2017.
GitHub @mariomed7at ·