includes/clientside/static/dropdown.js
changeset 853 21fea79d9de4
parent 806 543c05f86303
child 865 7f8262b2004a
equal deleted inserted replaced
852:e1ce6a91469b 853:21fea79d9de4
    98                 }
    98                 }
    99                 var dim = fetch_dimensions(ul);
    99                 var dim = fetch_dimensions(ul);
   100                 if ( !ul.id )
   100                 if ( !ul.id )
   101                   ul.id = 'jBoxmenuobj_' + Math.floor(Math.random() * 10000000);
   101                   ul.id = 'jBoxmenuobj_' + Math.floor(Math.random() * 10000000);
   102                 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
       
   103                 
       
   104                 if ( dim['w'] + $dynano(ul).Left() > getWidth() || $dynano(ul).hasClass('jbox_right') )
       
   105                 {
       
   106                   $dynano(ul).addClass('jbox_right');
       
   107                   ul.jbox_width = $dynano(ul).Width();
       
   108                 }
       
   109                 
   103                 ul.style.display = 'none';
   110                 ul.style.display = 'none';
   104                 domObjChangeOpac(100, ul);
   111                 domObjChangeOpac(100, ul);
   105                 
   112                 
   106                 // Setup events
   113                 // Setup events
   107                 obj.childNodes[i].onmouseover = function()  { jBoxOverHandler(this); };
   114                 obj.childNodes[i].onmouseover = function()  { jBoxOverHandler(this); };
   165     var dim = fetch_dimensions(obj);
   172     var dim = fetch_dimensions(obj);
   166     var off = fetch_offset(obj);
   173     var off = fetch_offset(obj);
   167     var dimh = parseInt(dim['h']);
   174     var dimh = parseInt(dim['h']);
   168     var offtop = parseInt(off['top']);
   175     var offtop = parseInt(off['top']);
   169     var top = dimh + offtop;
   176     var top = dimh + offtop;
   170     left = off['left'];
   177     if ( $dynano(ul).hasClass('jbox_right') )
       
   178     {
       
   179       left = $dynano(obj).Left() + $dynano(obj).Width() - ul.jbox_width; // ( link left + link width ) - ul width
       
   180     }
       
   181     else
       
   182     {
       
   183       left = off['left'];
       
   184     }
   171     if ( jBox_slide_enable )
   185     if ( jBox_slide_enable )
   172     {
   186     {
   173       domObjChangeOpac(0, ul);
   187       domObjChangeOpac(0, ul);
   174     }
   188     }
   175     ul.style.left = left + 'px';
   189     ul.style.left = left + 'px';