includes/clientside/static/dropdown.js
changeset 128 01955bf53f96
parent 80 cb7dde69c301
child 394 fbfdcea634a7
equal deleted inserted replaced
127:a2b20a832447 128:01955bf53f96
   121   for ( var i in others )
   121   for ( var i in others )
   122   {
   122   {
   123     if(typeof(others[i]) == 'object')
   123     if(typeof(others[i]) == 'object')
   124     {
   124     {
   125       others[i].style.display = 'none';
   125       others[i].style.display = 'none';
   126       others[i].previousSibling.className = '';
   126       $(others[i].previousSibling).rmClass('liteselected');
   127     }
   127     }
   128   }
   128   }
   129   var others = obj.parentNode.getElementsByTagName('div');
   129   var others = obj.parentNode.getElementsByTagName('div');
   130   for ( var i in others )
   130   for ( var i in others )
   131   {
   131   {
   132     if(typeof(others[i]) == 'object')
   132     if(typeof(others[i]) == 'object')
   133     {
   133     {
   134       if ( others[i].className == 'submenu' )
   134       if ( others[i].className == 'submenu' )
   135       {
   135       {
   136         others[i].style.display = 'none';
   136         others[i].style.display = 'none';
   137         others[i].previousSibling.className = '';
   137         $(others[i].previousSibling).rmClass('liteselected');
   138       }
   138       }
   139     }
   139     }
   140   }
   140   }
   141   if(obj.nextSibling.tagName.toLowerCase() == 'ul' || ( obj.nextSibling.tagName.toLowerCase() == 'div' && obj.nextSibling.className == 'submenu' ))
   141   if(obj.nextSibling.tagName.toLowerCase() == 'ul' || ( obj.nextSibling.tagName.toLowerCase() == 'div' && obj.nextSibling.className == 'submenu' ))
   142   {
   142   {
   143     obj.className = 'liteselected';
   143     $(a).addClass('liteselected');
       
   144     //obj.className = 'liteselected';
   144     var ul = obj.nextSibling;
   145     var ul = obj.nextSibling;
   145     var dim = fetch_dimensions(obj);
   146     var dim = fetch_dimensions(obj);
   146     var off = fetch_offset(obj);
   147     var off = fetch_offset(obj);
   147     var dimh = parseInt(dim['h']);
   148     var dimh = parseInt(dim['h']);
   148     var offtop = parseInt(off['top']);
   149     var offtop = parseInt(off['top']);
   195     return false;
   196     return false;
   196   }
   197   }
   197   
   198   
   198   if (!isOverObj(a, false, event) && !isOverObj(ul, true, event))
   199   if (!isOverObj(a, false, event) && !isOverObj(ul, true, event))
   199   {
   200   {
   200     a.className = '';
   201     $(a).rmClass('liteselected');
   201     
   202     
   202     if ( jBox_slide_enable )
   203     if ( jBox_slide_enable )
   203     {
   204     {
   204       slideIn(ul);
   205       slideIn(ul);
   205     }
   206     }
   397       {
   398       {
   398         for ( var j = 0; j < uls.length; j++ )
   399         for ( var j = 0; j < uls.length; j++ )
   399         {
   400         {
   400           if ( !isOverObj(uls[j], false, e) )
   401           if ( !isOverObj(uls[j], false, e) )
   401           {
   402           {
   402             uls[j].previousSibling.className = '';
   403             $(uls[j].previousSibling).rmClass('liteselected');
   403             //uls[j].style.display = 'none';
   404             //uls[j].style.display = 'none';
   404             slideIn(uls[j]);
   405             slideIn(uls[j]);
   405           }
   406           }
   406         }
   407         }
   407       }
   408       }
   410       {
   411       {
   411         for ( var j = 0; j < uls.length; j++ )
   412         for ( var j = 0; j < uls.length; j++ )
   412         {
   413         {
   413           if ( !isOverObj(uls[j], false, e) )
   414           if ( !isOverObj(uls[j], false, e) )
   414           {
   415           {
   415             uls[j].previousSibling.className = '';
   416             $(uls[j].previousSibling).rmClass('liteselected');
   416             //uls[j].style.display = 'none';
   417             //uls[j].style.display = 'none';
   417             slideIn(uls[j]);
   418             slideIn(uls[j]);
   418           }
   419           }
   419         }
   420         }
   420       }
   421       }