请教各位高手,我有一个frame框架的网页,左边是菜单,右边是显示的网页
显示一直都正常,点了左边的链接,新页面都是在右边出来
但是,右边有一个页我用javascript 控制了几个表格显示和隐藏,只要这个脚本执行过之后,再点框架左边的链接,就全都打开新窗口,很郁闷~请各位高手帮帮忙,谢谢
<SCRIPT language=JavaScript>
function hideAll()
{
document.getElementById("jz").style.display="none";
document.getElementById("gn").style.display="none";
document.getElementById("ys").style.display="none";
document.getElementById("al").style.display="none";
document.getElementById("jzi").style.background="url(../images2/bgbl.gif)";
document.getElementById("gni").style.background="url(../images2/bgbl.gif)";
document.getElementById("ysi").style.background="url(../images2/bgbl.gif)";
document.getElementById("ali").style.background="url(../images2/bgbl.gif)";
}function showFun(id)
{
if(id==1) name="jz";
if(id==2) name="gn";
if(id==3) name="ys";
if(id==4) name="al";
hideAll();
var imgname=name+"i";
//var imgurl="g"+id+"1.gif";
var imgurl="bggr.gif";
document.getElementById(name).style.display="block";
document.getElementById(imgname).style.background="url(../images2/"+imgurl+")";
}
</script>
显示一直都正常,点了左边的链接,新页面都是在右边出来
但是,右边有一个页我用javascript 控制了几个表格显示和隐藏,只要这个脚本执行过之后,再点框架左边的链接,就全都打开新窗口,很郁闷~请各位高手帮帮忙,谢谢
<SCRIPT language=JavaScript>
function hideAll()
{
document.getElementById("jz").style.display="none";
document.getElementById("gn").style.display="none";
document.getElementById("ys").style.display="none";
document.getElementById("al").style.display="none";
document.getElementById("jzi").style.background="url(../images2/bgbl.gif)";
document.getElementById("gni").style.background="url(../images2/bgbl.gif)";
document.getElementById("ysi").style.background="url(../images2/bgbl.gif)";
document.getElementById("ali").style.background="url(../images2/bgbl.gif)";
}function showFun(id)
{
if(id==1) name="jz";
if(id==2) name="gn";
if(id==3) name="ys";
if(id==4) name="al";
hideAll();
var imgname=name+"i";
//var imgurl="g"+id+"1.gif";
var imgurl="bggr.gif";
document.getElementById(name).style.display="block";
document.getElementById(imgname).style.background="url(../images2/"+imgurl+")";
}
</script>
左:
<a href="a.html" target="main">open</a>
main是iframe的name
右:
<iframe name="main"/>
不知道你是什么情况,怪!
<META http-equiv=Content-Type content="text/html; charset=gb2312"><SCRIPT language=JavaScript>
function hideAll()
{
document.getElementById("jz").style.display="none";
document.getElementById("gn").style.display="none";
document.getElementById("ys").style.display="none";
document.getElementById("al").style.display="none";
document.getElementById("jzi").style.background="url(../images2/bgbl.gif)";
document.getElementById("gni").style.background="url(../images2/bgbl.gif)";
document.getElementById("ysi").style.background="url(../images2/bgbl.gif)";
document.getElementById("ali").style.background="url(../images2/bgbl.gif)";
}function showFun(id)
{
if(id==1) name="jz";
if(id==2) name="gn";
if(id==3) name="ys";
if(id==4) name="al";
hideAll();
var imgname=name+"i";
//var imgurl="g"+id+"1.gif";
var imgurl="bggr.gif";
document.getElementById(name).style.display="block";
document.getElementById(imgname).style.background="url(../images2/"+imgurl+")";
}</script></HEAD>
<BODY>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td valign="top"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="6" height="26" valign="bottom" background="../images2/bgbl.gif"></td>
<td height="26" align="center" background="../images2/bggr.gif" id="jzi" style="CURSOR: hand" onMouseOver="showFun(1)">111</td>
<td height="26" align="center" background="../images2/bgbl.gif" id="gni" style="CURSOR: hand" onMouseOver="showFun(2)">222</td>
<td height="26" align="center" background="../images2/bgbl.gif" id="ysi" style="CURSOR: hand" onMouseOver="showFun(3)">333</td>
<td height="26" align="center" background="../images2/bgbl.gif" id="ali" style="CURSOR: hand" onMouseOver="showFun(4)">444</td>
<td width="6" height="26" valign="bottom" background="../images2/bgbl.gif"></td>
</tr>
</table></td>
</tr>
<tr>
<td height="99" valign="top"><table id="jz" width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="71">111</td>
</tr>
</table>
<table id="gn" width="100%" border="0" align="center" cellpadding="0" cellspacing="0" style="DISPLAY: none">
<!-- style="DISPLAY: none"-->
<tr>
<td>222</td>
</tr>
</table>
<table id="ys" width="100%" border="0" align="center" cellpadding="0" cellspacing="0" style="DISPLAY: none">
<!-- style="DISPLAY: none" -->
<tr>
<td>444</td>
</tr>
</table>
<table id="al" width="100%" border="0" align="center" cellpadding="0" cellspacing="0" style="DISPLAY: none">
<!-- style="DISPLAY: none" -->
<tr>
<td>333</td>
</tr>
</table></td>
</tr>
</table>
</BODY></HTML>
在function showFun(id)里边加了一句:
var name = "";
唉~