views:

376

answers:

2

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 event, however, the menu wont close when the mouse moves off the button (or the subsequent opened menu).

A: 

IIRC the menu closes when it loses focus, so your mouse enter/leave events should focus on and off the menu, respectively

peller
A: 

var projectsDropdown = new dijit.form.DropDownButton({ label: "Projects", name: "projects", dropDown: projectsMenu, onMouseOver: function() {this.openDropDown();}, onMouseLeave: function() {this.closeDropDown();}, id: "projectsButton"},"projectsDropdown");

Nick Ambrose