Bruno
Bruno

Reputation: 4655

Making a JQuery UI Menu close itself after a delay of mouseout

I have this situation, represented in a jsfiddle : http://jsfiddle.net/j2Y9h/1/

To reproduce my problem :

  1. Hover over the Menu to open the menu
  2. Hover over a SubMenu item without clicking
  3. Get the mouse out of the menu
  4. Wait (and don't click anywhere)

You'll notice that the menu never gets closed.

I would like to close the menu after let's say, 5 seconds have elapsed without the mouse coming back to the menu or submenus.

How?

Thanks :)

Upvotes: 0

Views: 848

Answers (1)

13ruce1337
13ruce1337

Reputation: 733

that being said, I got a lil' familiar with jquery-ui and forged this fiddle.

I used:

$('#menu').menu();
$('#menu').hover(function(){return false;},function () {
    $('#menu').menu("collapseAll", null, true);
});

for my javascript.

Upvotes: 3

Related Questions