ie和firefox中的js区别
小弟现有一段js代码,在ie中可以正常使用,但是到ff中就不能,望指教!代码如下:
<script type="text/JavaScript">
function showsubmenu(sid)
{
whichEl = eval("submenu" + sid);
imgmenu = eval("imgmenu" + sid);
if (whichEl.style.display == "none")
{
eval("submenu" + sid + ".style.display=\"\";");
imgmenu.background="images/bg_nav1.gif";
imgmenu.className='whi12B';
}
else
{
eval("submenu" + sid + ".style.display=\"none\";");
imgmenu.background="images/bg_nav.gif";
imgmenu.className='blu12B';
}
}
</script>
<table width="200" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="30"></td>
</tr>
<tr>
<td height="34" valign="bottom" background="images/bg_nav.gif" id="imgmenu0" style="cursor:hand" onClick="showsubmenu(0)" class="blu12B" onmouseover="showbg(0)" onmouseout="hidbg(0)"><div style="margin-left:34px; margin-bottom:13px">aaaaaaa</div></td>
</tr>
<tr>
<td id="submenu0" style="DISPLAY: none"><table width="200" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="34" height="21" align="right" background="../images/bg_nav.gif"><img src="../images/btm_tubiao7.gif" width="2" height="3" hspace="5" /></td>
<td width="166" align="left" valign="middle" background="../images/bg_nav.gif"><a href="11.htm" class="blk10" id="subitem1">11</a></td>
</tr>
<tr>
<td height="1" colspan="2" align="left" valign="top" background="../images/img_line1.gif"></td>
</tr>
<tr>
<td height="21" align="right" background="../images/bg_nav.gif"><img src="../images/btm_tubiao7.gif" width="2" height="3" hspace="5" /></td>
<td align="left" valign="middle" background="../images/bg_nav.gif"><a href="22.htm" class="blk10" id="subitem2">22</a></td>
</tr>
<tr>
<td height="1" colspan="2" align="left" valign="top" background="../images/img_line1.gif"></td>
</tr>
</table></td>
</tr>
</table>