使用JavaScript指令碼控制網頁Table的顯示隱藏

來源:互聯網
上載者:User
javascript|指令碼|控制|網頁|顯示

【需求】
如果大家登入過
我傲:http://www.woall.com
新浪部落格等
就會發現可以點擊欄目標題,就會發現欄目可以展開和收合,非常好用!其實這個功能實現起來很簡單.重點就是要找到要隱藏的Table行,對它的display屬性進行控制.

強烈建議大家登入:http://www.woall.com親身體驗一下!

【另】網址怎麼加連結啊???


【源碼】使用方法:把檔案考下來,儲存為htm類型的檔案即可!

<!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=gb2312" />
<title>無標題文檔</title>
<script language="javascript">
<!--
 function AXzhz(hideme)
 {
  var AX=document.all(hideme); //聲明一個變數
  AX.style.display=AX.style.display=="none"?"":"none"; //判斷是否隱藏
 }
//-->
</script>
</head>
<body>
<table width="200" border="1">
<!--title是滑鼠在上面的時候出現的提示-->
  <tr title="快啊快啊!!" >
    <td bgcolor="#FF9933">你點我啊!!</td>  
  </tr>
  <tr id="AX" style="display:none">
    <td bgcolor="#0099FF">AXzhz製作</td>
  </tr>
</table>
</body>
</html>



聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.