1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Getting Nav Menus To Dissapear OnMouseOut

Discussion in 'XenForo Development Discussions' started by Greg Bartlett, Jul 16, 2013.

  1. Greg Bartlett

    Greg Bartlett Member

    Okay, in xenforo.js, they use the query hoverintent which handles easing in and out of menu items. In Xenforo, it's only used to handle the delay for menu popups... and the only way to close a menu is to click elsewhere. And I understand that this is by design. I want to change that.

    It seems to me that the key is in line 220 of xenforo.js.

    Code:
    this.unreadDisplayTimeout=this.loading=null;this.newlyOpened=!1;this.$clicker=a.find('[rel="Menu"]').first().click(c.context(this,"controlClick"));XenForo.isTouchBrowser()||this.$clicker.mouseover(c.context(this,"controlHover")).hoverIntent({sensitivity:1,interval:100,timeout:0,over:c.context(this,"controlHoverIntent"),out:function(){}});this.$control=this.addPopupGadget(this.$clicker);this.popupGroup=this.$control.closest("[data-popupGroup]").data("popupGroup")},addPopupGadget:function(a){!a.hasClass("NoPopupGadget")&&
    I've changed it to this:

    Code:
    this.unreadDisplayTimeout=this.loading=null;this.newlyOpened=!1;this.$clicker=a.find('[rel="Menu"]').first().click(c.context(this,"controlClick"));XenForo.isTouchBrowser()||this.$clicker.mouseover(c.context(this,"controlHover")).hoverIntent({sensitivity:1,interval:100,timeout:1000,over:c.context(this,"controlHoverIntent"),out:c.context(this,"hideMenu")});this.$control=this.addPopupGadget(this.$clicker);this.popupGroup=this.$control.closest("[data-popupGroup]").data("popupGroup")},addPopupGadget:function(a){!a.hasClass("NoPopupGadget")&&
    And bam... it now closes the menu after a 1000 delay upon mouseout of the menu item.

    My question is, how can I make it do this for the whole popup menu, not just the single menu link in the nav bar? Most of this javascript is honestly beyond my abilities.
     

Share This Page