以下是我的代码,它是我从客户端获得的,它是非常旧的版本。现在他想立即运行它,所以我不能去新的菜单。
菜单正在本地工作但不能正常工作。
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="global.css" type="text/css">
<title>Swano Textile | Home Page</title>
<script language="JavaScript" type="text/JavaScript">function mmLoadMenus() {
if (window.mm_menu_0304202013_0) return;
window.mm_menu_0304202013_0 = new Menu("root",128,22,"Arial, Helvetica, sans-serif",12,"#000000","#000000","#A1DBFF","#C1FC42","left","middle",6,0,1000,-5,7,true,true,true,0,true,true);
mm_menu_0304202013_0.addMenuItem("Company Profile","window.open('profile.htm', '_parent');");
mm_menu_0304202013_0.hideOnMouseOut=true;
mm_menu_0304202013_0.bgColor='#555555';
mm_menu_0304202013_0.menuBorder=1;
mm_menu_0304202013_0.menuLiteBgColor='#FFFFFF';
mm_menu_0304202013_0.menuBorderBgColor='#FFFFFF';
window.mm_menu_0304202701_0 = new Menu("root",170,24,"Arial, Helvetica, sans-serif",12,"#000000","#000000","#A1DBFF","#C1FC42","left","middle",6,0,1000,-5,7,true,true,true,0,true,true);
mm_menu_0304202701_0.addMenuItem("Washing Plant","window.open('washingplant.htm', '_parent');");
mm_menu_0304202701_0.addMenuItem("Cutting Department","window.open('cuttingdept.htm', '_parent');");
mm_menu_0304202701_0.addMenuItem("Stitching Department","window.open('stitchingdept.htm', '_parent');");
mm_menu_0304202701_0.addMenuItem("Finishing Department","window.open('finishingdept.htm', '_parent');");
mm_menu_0304202701_0.addMenuItem("Embroidery Department","window.open('embroiderydept.htm', '_parent');");
mm_menu_0304202701_0.hideOnMouseOut=true;
mm_menu_0304202701_0.bgColor='#555555';
mm_menu_0304202701_0.menuBorder=1;
mm_menu_0304202701_0.menuLiteBgColor='#FFFFFF';
mm_menu_0304202701_0.menuBorderBgColor='#FFFFFF';
mm_menu_0304202701_0.writeMenus();
} // mmLoadMenus()
<!--
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
<script language="JavaScript" src="mm_menu.js"></script>
</head>
<body background="images/bg.gif" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="MM_preloadImages('images/but1_ove.gif','images/but2_ove.gif','images/but3_ove.gif','images/but4_ove.gif','images/but5_ove.gif','images/designedby_ove.gif')">
<script language="JavaScript1.2">mmLoadMenus();</script>
<table class="tableborder" align="center" width="779" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="left" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" background="images/but_bg.gif">
<tr align="left" valign="top">
<td bgcolor="#314349"><img src="images/spacer.gif" width="1" height="39"></td>
<td><a href="index.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image11','','images/but1_ove.gif',1)"><img src="images/but1.gif" alt="Home" name="Image11" width="108" height="39" border="0"></a></td>
<td><img src="images/but_spacer.gif" width="2" height="39"></td>
<td><a href="#" onMouseOut="MM_swapImgRestore();MM_startTimeout();" onMouseOver="MM_swapImage('Image12','','images/but2_ove.gif',1);MM_showMenu(window.mm_menu_0304202013_0,-2,39,null,'Image12')"><img src="images/but2.gif" name="Image12" width="107" height="39" border="1"></a></td>
<td><img src="images/but_spacer.gif" width="2" height="39"></td>
<td><a href="#" onMouseOut="MM_swapImgRestore();MM_startTimeout();" onMouseOver="MM_swapImage('Image13','','images/but3_ove.gif',1);MM_showMenu(window.mm_menu_0304202701_0,0,39,null,'Image13')"><img src="images/but3.gif" name="Image13" width="109" height="39" border="0"></a></td>
<td><img src="images/but_spacer.gif" width="2" height="39"></td>
<td><a href="production.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image14','','images/but4_ove.gif',1)"><img src="images/but4.gif" name="Image14" width="127" height="39" border="0"></a></td>
<td><img src="images/but_spacer.gif" width="2" height="39"></td>
<td><a href="contact.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image15','','images/but5_ove.gif',1)"><img src="images/but5.gif" name="Image15" width="109" height="39" border="0"></a></td>
<td><img src="images/but_spacer.gif" width="2" height="39"></td>
<td><img src="images/spacer.gif" width="206" height="1"></td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>
答案 0 :(得分:0)
如果您在使用mm_menu.js
之前添加function
,
<script language="JavaScript" src="mm_menu.js"></script>
<script>
//your javascript menu code
</script>
已更新您的mm_menu.js
授予error
使用
<script src="http://whowillbethenextonline.com/mm_examples/mm_menu.js"></script>
您尝试minify mm_menu.js
,但错过了some semicolons, etc
您可以使用JS Compiler minify
js
答案 1 :(得分:0)
我认为在Menu.js
function mmLoadMenus()
检查你的浴室<script language="JavaScript" src="./Swano Textile Home Page_files/mm_menu.js"></script>