Login   Register  
PHP Classes
elePHPant
Icontem

File: www/scripts/menu.js

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Graham Trott  >  Target CMS  >  www/scripts/menu.js  >  Download  
File: www/scripts/menu.js
Role: Auxiliary script
Content type: text/plain
Description: CSS script
Class: Target CMS
Content Management System
Author: By
Last change:
Date: 2010-07-26 05:26
Size: 815 bytes
 

Contents

Class file image Download
//<script language="JavaScript">

    var timeout     = 500;
    var closetimer  = 0;
    var ddmenuitem  = 0;

    // open hidden layer
    function mopen(id)
    {
        // cancel close timer
        mcancelclosetime();

        // close old layer
        if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';

        // get new layer and show it
        ddmenuitem = document.getElementById(id);
        ddmenuitem.style.visibility = 'visible';
    }
    // close showed layer
    function mclose()
    {
        if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
    }

    // go close timer
    function mclosetime()
    {
        closetimer = window.setTimeout(mclose, timeout);
    }

    // cancel close timer
    function mcancelclosetime()
    {
        if(closetimer)
        {
            window.clearTimeout(closetimer);
            closetimer = null;
        }
    }

    // close layer when click-out
    document.onclick = mclose;

//</script>