国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > JavaScript > 正文

JS實現黑色風格的網頁TAB選項卡效果代碼

2019-11-20 11:29:02
字體:
來源:轉載
供稿:網友

本文實例講述了JS實現黑色風格的網頁TAB選項卡效果代碼。分享給大家供大家參考。具體如下:

這是一款網頁TAB選項卡JS代碼,黑色超酷的風格,看了后你會喜歡的,很熟悉很經典的風格,似曾相識的感覺,希望大家喜歡。

運行效果截圖如下:

在線演示地址如下:

http://demo.VeVB.COm/js/2015/js-black-style-web-tab-demo/

具體代碼如下:

<!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>Tab切換</title><script type="text/jscript">function setTab(name,cursel,n){ for(i=1;i<=n;i++){ var menu=document.getElementById(name+i); var con=document.getElementById("con_"+name+"_"+i); menu.className=i==cursel?"hover":""; con.style.display=i==cursel?"block":"none"; }}</script><style type="text/css">*{ margin:0px; padding:0px; list-style:none;}.main{ width:306px; height:299px; float:left; margin:300px; display:inline; background:#000; padding:3px;}.main .menu{ width:306px; height:31px; overflow:hidden; float:left;}.main .menu span{ width:60px; height:30px; line-height:30px; overflow:hidden; text-align:center; float:left; margin:1px 0 0 1px; background:#333; color:#BCBCBC; font-weight:bold; cursor:pointer; font-size:12px;}.main .menu .hover{ background:#666; color:#FFF;}.main .content{ width:304px; height:266px; overflow:hidden; float:left; margin:1px; margin-top:0px; display:inline; background:#333333;}.main .content div{ width:304px; height:266px; line-height:266px; text-align:center; color:#FFFFFF; font-weight:bold; background:#666;}</style></head><body><div class="main"> <div class="menu">  <span id="one1" onclick="setTab('one',1,5)" class="hover">菜單一</span>  <span id="one2" onclick="setTab('one',2,5)">菜單二</span>  <span id="one3" onclick="setTab('one',3,5)">菜單三</span>  <span id="one4" onclick="setTab('one',4,5)">菜單四</span>  <span id="one5" onclick="setTab('one',5,5)">菜單五</span> </div> <div class="content">  <div id="con_one_1">內容一</div>  <div id="con_one_2" style="display:none">內容二</div>  <div id="con_one_3" style="display:none">內容三</div>  <div id="con_one_4" style="display:none">內容四</div>  <div id="con_one_5" style="display:none">內容五</div> </div></div></body></html>

希望本文所述對大家的JavaScript程序設計有所幫助。

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 长岭县| 吐鲁番市| 贵溪市| 阳信县| 江达县| 瓮安县| 永康市| 阳山县| 凤山市| 长岭县| 永宁县| 库伦旗| 全南县| 长白| 万盛区| 城步| 滁州市| 务川| 东台市| 合作市| 平度市| 永胜县| 孟州市| 固安县| 巢湖市| 津市市| 安化县| 合肥市| 稻城县| 香格里拉县| 印江| 重庆市| 陵水| 宽甸| 措美县| 高邑县| 长丰县| 开化县| 太湖县| 德清县| 阿拉善盟|