开发者

Open/Close Dojo Menu with mouse over event

开发者 https://www.devze.com 2022-12-20 12:52 出处:网络
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,

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

精彩评论

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

关注公众号