欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

基于JavaScript實(shí)現(xiàn)TAB標(biāo)簽效果

 更新時(shí)間:2016年01月12日 17:15:43   投稿:mrr  
js實(shí)現(xiàn)tab標(biāo)簽效果,在項(xiàng)目中經(jīng)常用到,今天抽點(diǎn)時(shí)間把我寫(xiě)的js實(shí)現(xiàn)tab標(biāo)簽效果源碼分享給大家,對(duì)js tab標(biāo)簽代碼需要的朋友參考下

 js實(shí)現(xiàn)tab標(biāo)簽效果,在項(xiàng)目中經(jīng)常用到,今天抽點(diǎn)時(shí)間把我寫(xiě)的js實(shí)現(xiàn)tab標(biāo)簽效果源碼分享給大家,對(duì)js tab標(biāo)簽代碼需要的朋友參考下

廢話不多說(shuō)了,直接給大家貼代碼了:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<meta name="keywords" content="JS代碼,TAB標(biāo)簽,JS廣告代碼,JS特效代碼" />
<meta name="description" content="此代碼內(nèi)容為不規(guī)則TAB選項(xiàng)卡效果,屬于站長(zhǎng)常用代碼,更多TAB標(biāo)簽代碼請(qǐng)?jiān)L問(wèn)腳本之家頻道。" />
<title>TAB選項(xiàng)卡效果</title>
<style type="text/css">
<!--
body,td{font-size: 12px;}
.tab{margin-top:100px}
//定義三個(gè)id
#TabTab03Con1{width:346px;height:100px;line-height:100px;border-left:#757575 1px solid;border-bottom:#757575 1px solid;border-right:#757575 1px solid;}
#TabTab03Con2{width:346px;height:100px;line-height:100px;border-left:#757575 1px solid;border-bottom:#757575 1px solid;border-right:#757575 1px solid;}
#TabTab03Con3{width:346px;height:100px;line-height:100px;border-left:#757575 1px solid;border-bottom:#757575 1px solid;border-right:#757575 1px solid;}
//定義三個(gè)標(biāo)簽類(lèi),放在標(biāo)簽頭位置,以及背景圖片的信息;
.xixi1{width:346px;height:27px;line-height:27px;background-image:url(images/01.jpg);cursor:pointer;}
.xixi2{width:346px;height:27px;line-height:27px;background-image:url(images/02.jpg);cursor:pointer;}
.xixi3{width:346px;height:27px;line-height:27px;background-image:url(images/03.jpg);cursor:pointer;}
//三個(gè)標(biāo)簽類(lèi)用于初始化標(biāo)簽大小位置等信息;
.tab1{width:115px;height:27px;line-height:27px;float:left;text-align:center;cursor:pointer;}
.tab2{width:115px;height:27px;line-height:27px;float:left;text-align:center;cursor:pointer;color:#FFFFFF;}
.tab3{width:115px;height:27px;line-height:27px;float:left;text-align:center;cursor:pointer;color:#FFFFFF;}
-->
</style>
</head>
<body style="text-align:center">
<script type=text/javascript>
function setTab03Syn ( i )
{
selectTab03Syn(i);
}
//設(shè)置在不同的標(biāo)簽上點(diǎn)擊時(shí),當(dāng)前標(biāo)簽以及其他標(biāo)簽的狀態(tài);
function selectTab03Syn ( i )
{
switch(i){
case 1:
document.getElementById("TabTab03Con1").style.display="block";
document.getElementById("TabTab03Con2").style.display="none";
document.getElementById("TabTab03Con3").style.display="none";
document.getElementById("font1").style.color="#000000";
document.getElementById("font2").style.color="#ffffff";
document.getElementById("font3").style.color="#ffffff";
break;
case 2:
document.getElementById("TabTab03Con1").style.display="none";
document.getElementById("TabTab03Con2").style.display="block";
document.getElementById("TabTab03Con3").style.display="none";
document.getElementById("font1").style.color="#ffffff";
document.getElementById("font2").style.color="#000000";
document.getElementById("font3").style.color="#ffffff";
break;
case 3:
document.getElementById("TabTab03Con1").style.display="none";
document.getElementById("TabTab03Con2").style.display="none";
document.getElementById("TabTab03Con3").style.display="block";
document.getElementById("font1").style.color="#ffffff";
document.getElementById("font2").style.color="#ffffff";
document.getElementById("font3").style.color="#000000";
break;
}
}
</script>
<div class="tab">
<div id="bg" class="xixi1">
<div id="font1" class="tab1" onMouseDown="setTab03Syn(1);document.getElementById('bg').className='xixi1'">page1</div>
<div id="font2" class="tab2" onMouseDown="setTab03Syn(2);document.getElementById('bg').className='xixi2'">page2</div>
<div id="font3" class="tab3" onMouseDown="setTab03Syn(3);document.getElementById('bg').className='xixi3'">page3</div>
</div>
<div id=TabTab03Con1> 不規(guī)則TAB選項(xiàng)卡效果1</div>
<div id=TabTab03Con2 style="display:none">不規(guī)則TAB選項(xiàng)卡效果2</div>
<div id=TabTab03Con3 style="display:none">不規(guī)則TAB選項(xiàng)卡效果3</div>
</div>
</body>
</html>

以上代碼經(jīng)小編測(cè)試過(guò)了,可以放心使用,當(dāng)然要根據(jù)個(gè)人項(xiàng)目需求,適當(dāng)?shù)脑鰟h改查,非常感謝大家對(duì)腳本之家網(wǎng)站的支持。

相關(guān)文章

最新評(píng)論