Login   Register  
PHP Classes
elePHPant
Icontem

File: docs/js/menu.js

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Stefan Löwe  >  Reingold Tilford  >  docs/js/menu.js  >  Download  
File: docs/js/menu.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Reingold Tilford
Render tree structures in several image formats
Author: By
Last change:
Date: 2011-11-07 13:37
Size: 671 bytes
 

Contents

Class file image Download
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;