<script language="javascript">
function showmenu(id)
{
if (document.getElementById("menu_"+id).style.display=="block")
{
document.getElementById("img_design_"+id).src="/images/trgl_nv_dot_close.jpg";
document.getElementById("menu_"+id).style.display="none";
}
else
{
document.getElementById("img_design_"+id).src="/images/trgl_nv_dot_open.jpg";
document.getElementById("menu_"+id).style.display="block";
}
}
</script>
<tr>
<td width="30" height="40" align="center"><img id="img_design_1" src="image/trgl_nv_dot_open.jpg" width="2" height="10"></td>
<td width="190"><div align="left" class="STYLE7"><A href="javascript:showmenu(1);" class="STYLE7">首席专家</A></div></td>
</tr>
<tr style="DISPLAY:block" id="menu_1" end="2">
<td>aaaa</td><td>bbbb</td>
</tr>为什么我点链接的时候,图片不能换掉呢??
function showmenu(id)
{
if (document.getElementById("menu_"+id).style.display=="block")
{
document.getElementById("img_design_"+id).src="/images/trgl_nv_dot_close.jpg";
document.getElementById("menu_"+id).style.display="none";
}
else
{
document.getElementById("img_design_"+id).src="/images/trgl_nv_dot_open.jpg";
document.getElementById("menu_"+id).style.display="block";
}
}
</script>
<tr>
<td width="30" height="40" align="center"><img id="img_design_1" src="image/trgl_nv_dot_open.jpg" width="2" height="10"></td>
<td width="190"><div align="left" class="STYLE7"><A href="javascript:showmenu(1);" class="STYLE7">首席专家</A></div></td>
</tr>
<tr style="DISPLAY:block" id="menu_1" end="2">
<td>aaaa</td><td>bbbb</td>
</tr>为什么我点链接的时候,图片不能换掉呢??
<table>
<tr>
<td width="30" height="40" align="center"> <img id="img_design_1" src="image/trgl_nv_dot_open.jpg" width="2" height="10"> </td>
<td width="190"> <div align="left" class="STYLE7"> <A href="javascript:showmenu(1);" class="STYLE7">首席专家 </A> </div> </td>
</tr>
<tr style="DISPLAY:block" id="menu_1" end="2">
<td>aaaa </td> <td>bbbb </td>
</tr>
</table>
把table加上
function showmenu(id)
{
if (document.getElementById("menu_"+id).style.display=="block")
{
document.getElementById("img_design_"+id).src="images/trgl_nv_dot_close.jpg";
document.getElementById("menu_"+id).style.display="none";
}
else
{
document.getElementById("img_design_"+id).src="images/trgl_nv_dot_open.jpg";
document.getElementById("menu_"+id).style.display="block";
}
}
</script>
PS:<img id="img_design_1" src="image/trgl_nv_dot_open.jpg" width="2" height="10">
图片的宽度为2PX,LZ能看得到吗
td中的地址是“image/..
不一致。。