亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

JS實(shí)現(xiàn)黑色風(fēng)格的網(wǎng)頁TAB選項(xiàng)卡效果代碼

 更新時(shí)間:2015年10月09日 11:10:40   作者:企鵝  
這篇文章主要介紹了JS實(shí)現(xiàn)黑色風(fēng)格的網(wǎng)頁TAB選項(xiàng)卡效果代碼,通過簡(jiǎn)單的頁面元素遍歷控制頁面tab切換效果,具有一定參考借鑒價(jià)值,需要的朋友可以參考下

本文實(shí)例講述了JS實(shí)現(xiàn)黑色風(fēng)格的網(wǎng)頁TAB選項(xiàng)卡效果代碼。分享給大家供大家參考。具體如下:

這是一款網(wǎng)頁TAB選項(xiàng)卡JS代碼,黑色超酷的風(fēng)格,看了后你會(huì)喜歡的,很熟悉很經(jīng)典的風(fēng)格,似曾相識(shí)的感覺,希望大家喜歡。

運(yùn)行效果截圖如下:

在線演示地址如下:

http://demo.jb51.net/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">內(nèi)容一</div>
  <div id="con_one_2" style="display:none">內(nèi)容二</div>
  <div id="con_one_3" style="display:none">內(nèi)容三</div>
  <div id="con_one_4" style="display:none">內(nèi)容四</div>
  <div id="con_one_5" style="display:none">內(nèi)容五</div>
 </div>
</div>
</body>
</html>

希望本文所述對(duì)大家的JavaScript程序設(shè)計(jì)有所幫助。

相關(guān)文章

最新評(píng)論