includes/clientside/static/dropdown.js
changeset 806 543c05f86303
parent 680 4cc27e7abd60
child 853 21fea79d9de4
equal deleted inserted replaced
805:b2dc28b9f367 806:543c05f86303
    81                 // Calculate height
    81                 // Calculate height
    82                 var ul = obj.childNodes[i].nextSibling;
    82                 var ul = obj.childNodes[i].nextSibling;
    83                 domObjChangeOpac(0, ul);
    83                 domObjChangeOpac(0, ul);
    84                 ul.style.display = 'block';
    84                 ul.style.display = 'block';
    85                 ul.style.zIndex = getHighestZ() + 2;
    85                 ul.style.zIndex = getHighestZ() + 2;
       
    86                 var links = ul.getElementsByTagName('a');
       
    87                 for ( var j = 0; j < links.length; j++ )
       
    88                 {
       
    89                   links[j].onmouseup = function()
       
    90                   {
       
    91                     var ul = this;
       
    92                     while ( ul.tagName != 'UL' && ul.tagName != 'DIV' && ul.tagName != 'BODY' )
       
    93                       ul = ul.parentNode;
       
    94                     if ( ul.tagName == 'BODY' )
       
    95                       return false;
       
    96                     jBoxHideMenu(ul.previousSibling, ul);
       
    97                   }
       
    98                 }
    86                 var dim = fetch_dimensions(ul);
    99                 var dim = fetch_dimensions(ul);
    87                 if ( !ul.id )
   100                 if ( !ul.id )
    88                   ul.id = 'jBoxmenuobj_' + Math.floor(Math.random() * 10000000);
   101                   ul.id = 'jBoxmenuobj_' + Math.floor(Math.random() * 10000000);
    89                 jBoxMenuHeights[ul.id] = parseInt(dim['h']) - 2; // subtract 2px for border width
   102                 jBoxMenuHeights[ul.id] = parseInt(dim['h']) - 2; // subtract 2px for border width
    90                 ul.style.display = 'none';
   103                 ul.style.display = 'none';
   202     return false;
   215     return false;
   203   }
   216   }
   204   
   217   
   205   if (!isOverObj(a, false, event) && !isOverObj(ul, true, event))
   218   if (!isOverObj(a, false, event) && !isOverObj(ul, true, event))
   206   {
   219   {
   207     $dynano(a).rmClass('liteselected');
   220     jBoxHideMenu(a, ul);
       
   221   }
       
   222   
       
   223   return true;
       
   224 }
       
   225 
       
   226 function jBoxHideMenu(a, ul)
       
   227 {
       
   228   $dynano(a).rmClass('liteselected');
   208     
   229     
   209     if ( jBox_slide_enable )
   230   if ( jBox_slide_enable )
   210     {
   231   {
   211       slideIn(ul);
   232     slideIn(ul);
   212     }
   233   }
   213     else
   234   else
   214     {
   235   {
   215       ul.style.display = 'none';
   236     ul.style.display = 'none';
   216     }
   237   }
   217     
       
   218   }
       
   219   
       
   220   return true;
       
   221 }
   238 }
   222 
   239 
   223 // Slide an element downwards until it is at full height.
   240 // Slide an element downwards until it is at full height.
   224 // First parameter should be a DOM object with style.display = block and opacity = 0.
   241 // First parameter should be a DOM object with style.display = block and opacity = 0.
   225 
   242