includes/clientside/static/dropdown.js
changeset 420 301f546688d1
parent 394 fbfdcea634a7
child 523 9d239396be42
equal deleted inserted replaced
419:b8b4e38825db 420:301f546688d1
    55 }
    55 }
    56 
    56 
    57 // Initializes a div with a jBox menu in it.
    57 // Initializes a div with a jBox menu in it.
    58 function jBoxSetup(obj)
    58 function jBoxSetup(obj)
    59 {
    59 {
    60   $(obj).addClass('menu');
    60   $dynano(obj).addClass('menu');
    61   removeTextNodes(obj);
    61   removeTextNodes(obj);
    62   
    62   
    63   for ( var i = 0; i < obj.childNodes.length; i++ )
    63   for ( var i = 0; i < obj.childNodes.length; i++ )
    64   {
    64   {
    65     /* normally this would be done in about 2 lines of code, but javascript is so picky..... */
    65     /* normally this would be done in about 2 lines of code, but javascript is so picky..... */
   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).rmClass('liteselected');
   126       $dynano(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).rmClass('liteselected');
   137         $dynano(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     $(a).addClass('liteselected');
   143     $dynano(a).addClass('liteselected');
   144     //obj.className = 'liteselected';
   144     //obj.className = 'liteselected';
   145     var ul = obj.nextSibling;
   145     var ul = obj.nextSibling;
   146     var dim = fetch_dimensions(obj);
   146     var dim = fetch_dimensions(obj);
   147     var off = fetch_offset(obj);
   147     var off = fetch_offset(obj);
   148     var dimh = parseInt(dim['h']);
   148     var dimh = parseInt(dim['h']);
   196     return false;
   196     return false;
   197   }
   197   }
   198   
   198   
   199   if (!isOverObj(a, false, event) && !isOverObj(ul, true, event))
   199   if (!isOverObj(a, false, event) && !isOverObj(ul, true, event))
   200   {
   200   {
   201     $(a).rmClass('liteselected');
   201     $dynano(a).rmClass('liteselected');
   202     
   202     
   203     if ( jBox_slide_enable )
   203     if ( jBox_slide_enable )
   204     {
   204     {
   205       slideIn(ul);
   205       slideIn(ul);
   206     }
   206     }
   388       {
   388       {
   389         for ( var j = 0; j < uls.length; j++ )
   389         for ( var j = 0; j < uls.length; j++ )
   390         {
   390         {
   391           if ( !isOverObj(uls[j], false, e) )
   391           if ( !isOverObj(uls[j], false, e) )
   392           {
   392           {
   393             $(uls[j].previousSibling).rmClass('liteselected');
   393             $dynano(uls[j].previousSibling).rmClass('liteselected');
   394             //uls[j].style.display = 'none';
   394             //uls[j].style.display = 'none';
   395             slideIn(uls[j]);
   395             slideIn(uls[j]);
   396           }
   396           }
   397         }
   397         }
   398       }
   398       }
   401       {
   401       {
   402         for ( var j = 0; j < uls.length; j++ )
   402         for ( var j = 0; j < uls.length; j++ )
   403         {
   403         {
   404           if ( !isOverObj(uls[j], false, e) )
   404           if ( !isOverObj(uls[j], false, e) )
   405           {
   405           {
   406             $(uls[j].previousSibling).rmClass('liteselected');
   406             $dynano(uls[j].previousSibling).rmClass('liteselected');
   407             //uls[j].style.display = 'none';
   407             //uls[j].style.display = 'none';
   408             slideIn(uls[j]);
   408             slideIn(uls[j]);
   409           }
   409           }
   410         }
   410         }
   411       }
   411       }
   528     object.MozOpacity = (opacity / 100);
   528     object.MozOpacity = (opacity / 100);
   529     object.KhtmlOpacity = (opacity / 100);
   529     object.KhtmlOpacity = (opacity / 100);
   530     object.filter = "alpha(opacity=" + opacity + ")";
   530     object.filter = "alpha(opacity=" + opacity + ")";
   531 }
   531 }
   532 
   532 
       
   533 function getScrollOffset()
       
   534 {
       
   535   var position;
       
   536   if (self.pageYOffset)
       
   537   {
       
   538     position = self.pageYOffset;
       
   539   }
       
   540   else if (document.documentElement && document.documentElement.scrollTop)
       
   541   {
       
   542     position = document.documentElement.scrollTop;
       
   543   }
       
   544   else if (document.body)
       
   545   {
       
   546     position = document.body.scrollTop;
       
   547   }
       
   548   return position;
       
   549 }
       
   550