此乃层的隐藏与显示也, 一、点击左边的缩进图片,左边栏收缩 二、实现的思路 1、图片作为按扭,点击图片触发层的显示和收缩,图片代码如下: <A href="javascript:show()"><IMG src="image/fclose.gif" align="absmiddle" border="0"></A>三、源代码 <HTML><HEAD><META http-equiv="Content-Type" content="text/htmlcharset=gb2312"><TITLE>收缩左边栏效果</TITLE><STYLE type="text/css">td{font-size:12pxline-height:22px} .red{color: #FF0000} </STYLE><SCRIPT language="JavaScript">function show(){ if(document.getElementById("left").style.display=='none'){ //判断目前左边栏的状态(显示、隐藏) document.getElementById("left").style.display='block'//显示左边栏 } else{document.getElementById("left").style.display='none'//隐藏左边栏} } </SCRIPT></HEAD><BODY><TABLE width="98%" border="0" cellspacing="0" cellpadding="0" align="center"><TR><TD id="left" width="200">点点右边的收缩按钮,看看我是不是进去了!</TD><TD width="8" style="border-right:1 #cccccc solid"><A href="javascript:show()"><IMG src="image/fclose.jpg" align="absmiddle" border="0"></A></TD><TD valign="top">右侧</TD></TR></TABLE> </BODY></HTML><html>
<body>
<table border="0" width="100%" cellpadding="10">
<tr>
<td width="50%" valign="top">
This is some text. This is some text. This is some text. This is some text. This is some
text.
</td>
<td width="50%" valign="top">
Another text. Another text. Another text. Another text. Another text. Another text. Another
text.
</td>
</tr>
</table>
<table border="0" width="100%" cellpadding="10">
<tr>
<td width="50%" valign="top">
This is some text. This is some text. This is some text. This is some text. This is some
text.
</td>
<td width="50%" valign="top">
Another text. Another text. Another text. Another text. Another text. Another text. Another
text.
</td>
</tr>
</table>
</body>
</html>