如何在鼠标移出时隐藏主面菜单栏
How to hide primefaces menubar on mouseout
我需要让p:menubar
隐藏在mouseout
上。我怎么才能得到这个?尝试覆盖PrimeFaces.widget.Menubar.prototype
方法,但总是有些东西被打破。
下一个解决方案适合我。我启动定时器隐藏所有在停用,清除它在激活和重新激活。
PrimeFaces.widget.Menubar.prototype.deactivate = function(b, a) {
var menu = this;
menu.activeitem = null;
b.children("a.ui-menuitem-link").removeClass(
"ui-state-hover ui-state-active");
b.removeClass("ui-menuitem-active ui-menuitem-highlight");
if (a) {
b.children("ul.ui-menu-child").fadeOut("fast");
} else {
b.children("ul.ui-menu-child").hide();
if (!this.timer) {
this.timer = setTimeout(function() {
menu.reset();
}, 300);
}
}
}
PrimeFaces.widget.Menubar.prototype.reactivate = function(d) {
if (this.timer) {
clearTimeout(this.timer);
this.timer = null;
}
this.activeitem = d;
var c = d.children("ul.ui-menu-child"), b = c
.children("li.ui-menuitem-active:first"), a = this;
if (b.length == 1) {
a.deactivate(b)
}
}
PrimeFaces.widget.Menubar.prototype.activate = function(b) {
if (this.timer) {
clearTimeout(this.timer);
this.timer = null;
}
this.highlight(b);
var a = b.children("ul.ui-menu-child");
if (a.length == 1) {
this.showSubmenu(b, a)
}
}
相关文章:
- 滚动后保持固定的菜单栏不起作用
- 菜单栏class=活动引导程序主题无法正常工作
- 在BootStrap菜单栏中为所选项目设置背景,类似于BootStrap中的父导航选项
- 通过侧菜单栏进行rails页面导航
- Dojo菜单栏选定状态
- 向下滚动时隐藏菜单,向上滚动时显示,适用于Chrome,不适用于Safari(手机)
- 如何使用jQuery显示/隐藏菜单
- 如何在IE中隐藏菜单栏,工具栏
- 使用 Javascript 单击 ESC 时隐藏菜单
- 处理一个项目,想要添加以下菜单栏,并尽量减少向下滑动
- 自动隐藏地址栏问题
- 使用 jQuery 显示和隐藏菜单
- 无法在 NW.js 中切换窗口菜单栏可见性
- 突出显示菜单栏上的活动菜单项
- 我的菜单栏隐藏在PasteBin的javascript下
- Electron从菜单栏打开新的全屏窗口
- 单击菜单栏打开jQuery对话框作为登录框
- 如何让我的移动菜单按钮显示和隐藏导航栏,以及在负空间中单击时隐藏
- 使用 javascript 在页面加载时隐藏浏览器菜单栏
- 如何在鼠标移出时隐藏主面菜单栏