开发者

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");
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜