Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Having an issue with horizontal menus #13

Open
zaggwarrior opened this issue Mar 28, 2013 · 2 comments
Open

Having an issue with horizontal menus #13

zaggwarrior opened this issue Mar 28, 2013 · 2 comments

Comments

@zaggwarrior
Copy link

Horizontal_Example

When going from Monitor to System Monitor (Hitting the black area), the exitMenu is triggered. I have configured the submenuDirection as "below". Is there anyway to prevent the exitMenu from being triggered?

The basic code layout is
< ul>
< li>
< a href ="#">System
< ul>
< li>Item1
< li>Item2
< /ul>
< /li>
< /ul>

Any suggestions?

Thanks

@beipawel
Copy link

Hi, I solved it as followed:

when exiting the menu I start a timeout on a function that will trigger a mouseleave event on this menu. This happens when tout is null. When entering any row I stop the deactivate the timeout => Submenu is still displayed. When I really leave the menu, then after 1200ms the mouseleave event is triggert on the menu. As tout is now set (it has some number, hence is true) the exitMenu method returns true and the menu will be closed.

Hope that helps. I needed myself some time to figure out that solution.

// [ … ]
function deactivateMenu(menuobj,menu) {
$(menu).trigger('mouseleave');
}

// menu hide timeout
var tout;

$('#catNavL1').menuAim({
activate: activateSubMenu,
deactivate: deactivateSubMenu,
exitMenu: function(menu) {
var $this = this;
if ( ! tout ) {
tout = setTimeout(function () {
deactivateMenu($this,menu);
}, 1200);
return false;
}
return true;
},
enter: function(row) {
/* stop timeout */
window.clearTimeout(tout);
tout = null;
var $row = $(row),
$submenu = $row.find('ul:first');
},
submenuDirection: "below"
});

@infabo
Copy link

infabo commented Jul 10, 2015

This solution is not working

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants