1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
| DDMenu={t:25,ni:10,tc:700,m:[],z:50,
Wrap:function(n){var w=document.getElementById(n),s=w.getElementsByTagName('ul'),l=s.length;this.m[n]=[];
for(i=0;i<l;i++){
s[i].style.display='block';s[i].style.visibility='hidden';
c=this.m[n][i]={e:s[i],h:s[i].offsetHeight,w:s[i].offsetWidth,i:0};
c.e.style.height=c.h+"px";c.h-=c.e.offsetHeight-c.h;
c.e.style.width=c.w+"px";c.w-=c.e.offsetWidth-c.w;
c.e.style.zIndex=this.z;this.z++;
c.e.parentNode.onmouseover=Function("DDMenu.onOpen('"+n+"',"+i+")");
c.e.parentNode.onmouseout=Function("DDMenu.onClose('"+n+"',"+i+")");
};
},
onOpen:function(n,i){var c=this.m[n][i];
if(!c.t){c.e.style.visibility='visible'};
clearInterval(c.t);c.t=setInterval(function(){DDMenu.onOpen(n,i)},this.t);
if(c.i==this.ni){c.e.style.overflow='visible';c.e.style.filter='';clearInterval(c.t);}
else {
c.e.style.overflow='hidden';
c.i++;
o=c.i/this.ni;c.e.style.opacity=o;c.e.style.filter='alpha(opacity='+(o*100)+')';
c.e.style.height=Math.ceil(c.h*(c.i/this.ni))+"px";
c.e.style.width=Math.ceil(c.w*(c.i/this.ni))+"px";
};
},
onClose:function(n,i){var c=this.m[n][i];
function AfterTimeout(){
clearInterval(c.t);
if(c.i!=0){
c.t=setInterval(function(){AfterTimeout()},DDMenu.t);
c.i--;
o=c.i/DDMenu.ni;c.e.style.opacity=o;c.e.style.filter='alpha(opacity='+(o*100)+')';
};
};
clearInterval(c.t);c.t=setTimeout(function(){AfterTimeout()},(c.i==this.ni)?this.tc:0);
}
} |