Open/Close Dojo Menu with mouse over event
Does anyone know how to open/close a dojo dropdown menu with the mouseenter/mouseleave events?
Actually, I've successfully opened the menu with the mouseenter eve开发者_StackOverflow社区nt, however, the menu wont close when the mouse moves off the button (or the subsequent opened menu).
IIRC the menu closes when it loses focus, so your mouse enter/leave events should focus on and off the menu, respectively
var projectsDropdown = new dijit.form.DropDownButton({
label: "Projects",
name: "projects",
dropDown: projectsMenu,
onMouseOver: function()
{this.openDropDown();},
onMouseLeave: function()
{this.closeDropDown();},
id: "projectsButton"},"projectsDropdown");
精彩评论