這是學習視頻時做的例子,感覺不錯就儲存一下,下面是:
下面是例子的源碼:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>分欄模式</title><script language="javascript" type="text/javascript">function yc(){document.getElementById("lanmu").style.display="none";//document.getElementById("img").src="picture/tupian2.png"document.getElementById("img").innerHTML = "<img src='picture/tupian2.png' width='11' height='47' alt='顯示按鈕' onclick='xs();'>";}function xs(){document.getElementById("lanmu").style.display="";document.getElementById("img").innerHTML="<img src='picture/tupian1.png' width='11' height='47' alt='縮排按鈕' onclick='yc();'/>"}</script></head><body><table width="500" height="400" border="1"> <tr> <td id="lanmu" width="96" align="center"> <p><a href="#">欄目一</a></p><p><a href="#">欄目二</a></p><p><a href="#">欄目三</a></p><p><a href="#">欄目四</a></p><p><a href="#">欄目五</a></p></td> <td width="8"> <span id="img"><img src="picture/tupian1.png" width="11" height="47" alt="縮排按鈕" onclick="yc();"/></span> </td> <td width="374" align="center">這裡是內容地區!!!</td> </tr></table></body></html>