aboutsummaryrefslogtreecommitdiffstats
path: root/doc/phpdoc/js/menu.js
blob: e94e53148ccc5ccac3af80735e8d0e456dc9f2da (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
var timeout    = 500;
var closetimer = 0;
var ddmenuitem = 0;

function menu_open() {
    menu_canceltimer();
    menu_close();
    ddmenuitem = $(this).find('ul').css('visibility', 'visible');
}

function menu_close() {
    if (ddmenuitem) ddmenuitem.css('visibility', 'hidden');
}

function menu_timer() {
    closetimer = window.setTimeout(menu_close, timeout);
}

function menu_canceltimer() {
    if (closetimer) {
        window.clearTimeout(closetimer);
        closetimer = null;
    }
}

$(document).ready(function() {
    $('#file-nav > li').bind('mouseover', menu_open);
    $('#file-nav > li').bind('mouseout', menu_timer);
});

document.onclick = menu_close;