I was using the menu function from jQuery-ui. See my example fiddle
My problem is that when you mouse-over a menu and you exit, all submenu exits too. But when you are in a submenu and you leave, the submenu will stay open. it won't close until you click outside the menu
I tried to add this code but it won't work :
$("#menu").mouseleave( function(){
$(".ui-menu-item").collapseAll();
});
I want the submenu to disappear too once I leave with the mouse