79、可隐藏的导航表格

79、可隐藏的导航表格

脚本说明:

把如下代码加入<body>区域中

<style type="text/css">

<!--

td { font-size: 12px; line-height: 150%}

-->

</style>

<script language="JavaScript">

<!--

 

function hve_display(t_id,i_id){//显示隐藏程序

var t_id;//表格ID

var i_id;//图片ID

var on_img="2308.gif";//打开时图片

var off_img="2305.gif";//隐藏时图片

if (t_id.style.display == "none") {//如果为隐藏状态

t_id.style.display="";//切换为显示状态

i_id.src=on_img;}//换图

else{//否则

t_id.style.display="none";//切换为隐藏状态

i_id.src=off_img;}//换图

}

 

//-->

</script>

<table width="500">

<tr>

<td>

<table width="200" border="0" cellspacing="1" cellpadding="0" bgcolor="#006699">

<tr bgcolor="#006699">

<td> </td>

<td width="20"><img src="2308.gif" width="17" height="14" name="img1" onClick="hve_display(table1,img1)" style="cursor: hand"></td></tr>

<!--图片的IDimg1,要隐藏的表格IDtable1onclick调用hve_display程序;style设置鼠标为手型。-->

</table>

<table ID="table1" width="200" border="0" cellspacing="1" cellpadding="0" bgcolor="#006699" height="120">

<tr bgcolor="#FFFFFF">

<td bgcolor="#7AACFE">  </td>

</tr>

</table>

 

<br>

<table width="200" border="0" cellspacing="1" cellpadding="0" bgcolor="#006699">

<tr bgcolor="#006699">

<td> </td>

<td width="20"><img src="2308.gif" width="17" height="14" name="img2" onClick="hve_display(table2,img2)" style="cursor: hand"></td>

</tr>

</table>

<table id="table2" width="200" border="0" cellspacing="1" cellpadding="0" bgcolor="#006699" height="120">

<tr bgcolor="#FFFFFF">

<td bgcolor="#7AACFE">  </td>

</tr>

</table>

<br>

<table width="200" border="0" cellspacing="1" cellpadding="0" bgcolor="#006699">

<tr bgcolor="#006699">

<td> </td>

<td width="20"><img src="2308.gif" width="17" height="14" name="img3" onClick="hve_display(table3,img3)" style="cursor: hand"></td>

</tr>

</table>

<table id="table3" width="201" border="0" cellspacing="1" cellpadding="0" bgcolor="#006699" height="120">

<tr bgcolor="#FFFFFF">

<td bgcolor="#7AACFE">  </td>

</tr>

</table>

<br>

<table width="200" border="0" cellspacing="1" cellpadding="0" bgcolor="#006699">

<tr bgcolor="#006699">

<td> </td>

<td width="20"><img src="2308.gif" width="17" height="14" name="img4" onClick="hve_display(table4,img4)" style="cursor: hand"></td>

</tr>

</table>

<table id="table4" width="200" border="0" cellspacing="1" cellpadding="0" bgcolor="#006699" height="120">

<tr bgcolor="#FFFFFF">

<td bgcolor="#7AACFE">  </td>

</tr>

</table>

</td>

</tr>

</table>

 

 

Write a comment

Comments: 0