javascript 選項卡實現代碼

來源:互聯網
上載者:User
提示:您可以先修改部分代碼再運行

<style>body {font-family: Arial,"宋體";font-size:9pt;}td { font-size:12px;;}.mousehand{cursor:hand;}.titletable{padding-left:5px;background-color:#E9E9E9; }table.TabBarLevel1{}table.TabBarLevel1 td{ border:1px solid #CCCCCC; height:20px; background-color:#E1E1E1;}table.TabBarLevel1 td.Selected{ border-bottom-width:0px; background-color:#ffffff;}table.TabBarLevel1 td.Black{ border-left-width:0px; border-top-width:0px; border-right-width:0px; background-color:#FFFFFF;}table.Content{ border-left:1px solid #CCCCCC; border-right:1px solid #CCCCCC; border-bottom:1px solid #CCCCCC;}</style><table width="600" border="0" cellspacing="0" cellpadding="0"> <tr> <td><table width="100%" border="0" cellspacing="0" cellpadding="0" class="TabBarLevel1" id="TabPage1"> <tr align="center"> <td width="130" id="imageTab1" valign="middle" class="mousehand" onclick="javascript:switchTab('TabPage1','imageTab1','心開風神','image');">熱門圖片</td> <td width="7" class="Black"> </td> <td width="80" id="imageTab2" valign="middle" class="mousehand" onclick="javascript:switchTab('TabPage1','imageTab2','子虛烏有','image');">波希米亞</td> <td width="7" class="Black"> </td> <td width="80" id="imageTab3" valign="middle" class="Selected mousehand" onclick="javascript:switchTab('TabPage1','imageTab3','孤零飄客','image');">紅色駭客</td> <td width="7" class="Black"> </td> <td width="" align="right" class="Black">www.111cn.net  </td> </tr> </table> <table width="100%" border="0" cellpadding="0" cellspacing="0" class="Content"> <tr> <td height="110"><div id="divimagelist_all"> 正在載入...</div></td> </tr> </table></td> </tr></table><script language="javascript">function switchTab(tabpage,tabid,action,type){var oItem = document.getElementById(tabpage); for(var i=1;i< 4;i++){var x = document.getElementById(type + 'Tab' + i);//alert(x);x.className = "mousehand";//var y = x.getElementsByTagName('a');//y[0].style.color="#333333";}document.getElementById(tabid).className = "Selected";//gethotimagelist(type+'_'+action);divimagelist_all.innerHTML = type+'_'+action;}</script></td> </tr></table>
提示:您可以先修改部分代碼再運行

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.