各种菜单代码Word格式文档下载.docx
《各种菜单代码Word格式文档下载.docx》由会员分享,可在线阅读,更多相关《各种菜单代码Word格式文档下载.docx(68页珍藏版)》请在冰豆网上搜索。
#799310'
mmenuovercolor='
#004080'
mitemedge='
0'
msubedge='
1'
mmenuunitwidth=66;
mmenuitemwidth=140;
mmenuheight=25;
mmenuwidth='
100%'
mmenuadjust=0;
mmenuadjustV=0;
mfonts='
font-family:
宋体;
font-size:
9pt;
color:
MenuText;
'
mcursor='
hand'
varswipeSteps=4;
varswipemsec=25;
varswipeArray=newArray();
functionswipe(el,dir,steps,msec){
if(steps==null)steps=swipeSteps;
if(msec==null)msec=swipemsec;
if(el.swipeIndex==null)
el.swipeIndex=swipeArray.length;
if(el.swipeTimer!
=null)
window.clearTimeout(el.swipeTimer);
swipeArray[el.swipeIndex]=el;
el.style.clip="
rect(-99999,99999,99999,-99999)"
if(el.swipeCounter==null||el.swipeCounter==0){
el.orgLeft=el.offsetLeft;
el.orgTop=el.offsetTop;
el.orgWidth=el.offsetWidth;
el.orgHeight=el.offsetHeight;
}
el.swipeCounter=steps;
rect(0,0,0,0)"
window.setTimeout("
repeat("
+dir+"
"
+el.swipeIndex+"
+steps+"
+msec+"
)"
msec);
}
functionrepeat(dir,index,steps,msec){
el=swipeArray[index];
varleft=el.orgLeft;
vartop=el.orgTop;
varwidth=el.orgWidth;
varheight=el.orgHeight;
if(el.swipeCounter==0){
el.style.clip="
return;
else{
el.swipeCounter--;
el.style.visibility="
visible"
switch(dir){
case2:
el.style.clip="
rect("
+height*el.swipeCounter/steps+"
+width+"
+height+"
+0+"
el.style.top=top-height*el.swipeCounter/steps;
break;
case8:
+height*(steps-el.swipeCounter)/steps+"
el.style.top=top+height*el.swipeCounter/steps;
case6:
+width*(el.swipeCounter)/steps+"
el.style.left=left-width*el.swipeCounter/steps;
case4:
+width*(swipeSteps-el.swipeCounter)/steps+"
el.style.left=left+width*el.swipeCounter/steps;
}
el.swipeTimer=window.setTimeout("
+index+"
varmtmpleft="
"
varmtmptop="
functionhideSwipe(el){
window.clearTimeout(el.swipeTimer);
el.style.visibility="
hidden"
el.swipeCounter=0;
if(mtmpleft!
="
)el.style.left=mtmpleft;
if(mtmptop!
)el.style.top=mtmptop;
functionstoperror(){
returntrue;
window.onerror=stoperror;
functionmpopOut(){
mpopTimer=setTimeout('
mallhide()'
500);
functiongetReal(el,type,value){
temp=el;
while((temp!
=null)&
&
(temp.tagName!
="
BODY"
)){
if(eval("
temp."
+type)==value){
el=temp;
returnel;
temp=temp.parentElement;
returnel;
functionmMenuRegister(menu)
{
mmenus[mmenus.length]=menu
return(mmenus.length-1)
functionmMenuItem(caption,command,target,isline,statustxt,level,img,sizex,sizey,pos){
this.items=newArray();
this.caption=caption;
mand=command;
this.target=target;
this.isline=isline;
this.statustxt=statustxt;
if(level!
=null){mnumberofsub++;
this.hasc=mnumberofsub;
this.level=level;
this.img=img;
this.sizex=sizex;
this.sizey=sizey;
this.pos=pos;
functionmMenu(caption,command,target,img,sizex,sizey,pos){
this.id=mMenuRegister(this);
functionmMenuAddItem(item)
this.items[this.items.length]=item
item.parent=this.id;
this.children=true;
mMenu.prototype.addItem=mMenuAddItem;
mMenuItem.prototype.addsubItem=mMenuAddItem;
functionmtoout(src){
src.style.borderLeftColor=mmenuoutbordercolor;
src.style.borderRightColor=mmenuinbordercolor;
src.style.borderTopColor=mmenuoutbordercolor;
src.style.borderBottomColor=mmenuinbordercolor;
src.style.backgroundColor=mmenuoutcolor;
src.style.color=mmenuovercolor;
functionmtoin(src){
src.style.borderLeftColor=mmenuinbordercolor;
src.style.borderRightColor=mmenuoutbordercolor;
src.style.borderTopColor=mmenuinbordercolor;
src.style.borderBottomColor=mmenuoutbordercolor;
src.style.backgroundColor=mmenuincolor;
functionmnochange(src){
src.style.borderLeftColor=mmenucolor;
src.style.borderRightColor=mmenucolor;
src.style.borderTopColor=mmenucolor;
src.style.borderBottomColor=mmenucolor;
src.style.backgroundColor='
'
src.style.color=mfontcolor;
functionmallhide(){
for(varnummenu=0;
nummenu<
mmenus.length;
nummenu++){
varthemenu=document.all['
mMenu'
+nummenu]
varthemenudiv=document.all['
mmenudiv'
mnochange(themenu);
mmenuhide(themenudiv);
for(nummenu=1;
=mnumberofsub;
nummenu++){
varthesub=document.all['
msubmenudiv'
+nummenu]
msubmenuhide(thesub);
mnochange(document.all['
mp'
+nummenu]);
document.all["
mitem"
+nummenu].style.color=mfontcolor;
functionmmenuhide(menuid){
menuid.style.filter='
Alpha(Opacity=100)'
hideSwipe(menuid);
functionmsubmenuhide(menuid){
menuid.style.visibility='
hidden'
functionmmenushow(menuid,pid){
Alpha(Opacity=80)'
menuid.style.left=mposflag.offsetLeft+pid.offsetLeft+mmenuadjust;
menuid.style.top=mposflag.offsetTop+mmenutable.offsetHeight+mmenuadjustV;
if(mmenuitemwidth+parseInt(menuid.style.left)>
document.body.clientWidth+document.body.scrollLeft)
menuid.style.left=document.body.clientWidth+document.body.scrollLeft-mmenuitemwidth;
mtmpleft=menuid.style.left;
mtmptop=menuid.style.top;
swipe(menuid,2,4);
misShow=true;
functionmshowsubmenu(menuid,pid,rid){
menuid.style.left=pid.offsetWidth+rid.offsetLeft;
menuid.style.top=pid.offsetTop+rid.offsetTop-3;
visible'
functionmmenu_over(menuid,x){
toel=getReal(window.event.toElement,"
className"
"
coolButton"
);
fromel=getReal(window.event.fromElement,"
if(toel==fromel)return;
if(x<
0){
misShow=false;
mallhide();
mtoout(eval("
mMenu"
+x));
}else{
mtoin(eval("
mmenushow(menuid,eval("
clearTimeout(mpopTimer);
functionmmenu_out(x){
if(misShow){
mtoin(eval("
mnochange(eval("
mpopOut()
functionmmenu_down(menuid,x){
if(misShow){
mmenuhide(menuid);
else{
misdown=true;
functionmmenu_up(){
misdown=false;
functionmmenuitem_over(menuid,item,x,j,i){
srcel=getReal(window.event.srcElement,"
if(!
(menuid==thesub||menuid.style.tag>
=thesub.style.tag)){
if(item)document.all["
+item].style.color=mmenuovercolor;
if(misdown||item){
mtoin(srcel);
else{
mtoout(srcel);
if(x==-1)mthestatus=eval("
msub"
+j).items[i].statustxt;
if(j==-1)mthestatus=mmenus[x].items[i].statustxt;
if(mthestatus!
){
musestatus=true;
window.status=mthestatus;
functionmmenuitem_out(hassub){
if(!
hassub)mnochange(srcel);
if(musestatus)window.status="
functionmmenuitem_down(){
mtoin(srcel)
misdown=true;
functionmmenuitem_up(){
mtoout(srcel)
functionmexec3(j,i){
varcmd;
if(eval("
+j).items[i].target=="
blank"
cmd="
window.open('
+eval("
+j).items[i].command+"
cmd=eval("
+j).items[i].target+"
.location=\"
\"
eval(cmd);
functionmexec2(x){
if(mmenus[x].target=="
+mmenus[x].command+"
cmd=mmenus[x].target+"
functionmexec(x,i){
if(mmenus[x].items[i].target=="
+mmenus[x].items[i].command+"
cmd=mmenus[x].items[i].target+"
functionmbody_click(){
srcel=getReal(window.event.srcElement,"
for(varx=0;
x<
=mmenus.length