css滑動門技術02
來源:互聯網
上載者:User
<!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>
<style media="screen" type="text/css">
<!--
*{font-size:12px;}
html,body{margin:0;text-align:center;over-flow:hidden;height:100%;width:100%;}
UL{list-style-type:none; margin:0px;}
/* 標準盒模型 */
.ttl{height:18px;}
.ctt{height:auto;padding:6px;clear:both;border:1px solid #064ca1;border-top:0;text-align:left;}
.w936{margin:2px 0;clear:both;width:760px;/*這裡調整整個滑動門的寬度*/}
/* TAB 轉場效果 */
.tb_{background-image: url('http://bbs.blueidea.com/attachments/2007/7/25/20070725_f1bc0d9938343cee9284V0FVZAdoP1qg.gif'); background-repeat: repeat-x;background-color: #E6F2FF;}
.tb_ ul{height:24px;}
.tb_ li{float:left;height: 24px;line-height:1.9;width: 94px;cursor:pointer;}
/* 用於控制顯示與隱藏的css類 */
.normaltab { background-image:url('http://bbs.blueidea.com/attachments/2007/7/25/20070725_2d45897999776e6db406gVeObFuGVeFv.gif'); background-repeat: no-repeat; color:#1F3A87 ;}
.hovertab { background-image: url('http://bbs.blueidea.com/attachments/2007/7/25/20070725_e6bd56769bc5c11ef295XkCck2oL8hym.gif'); background-repeat: no-repeat; color:#1F3A87; font-weight:bold }
.dis{display:block;}
.undis{display:none;}
-->
</style>
<script type="text/javascript" language="javascript">
//<!CDATA[
function g(o){
return document.getElementById(o);
}
function HoverLi(n){
for(var i=1;i<=6;i++){
g('tb_'+i).className='normaltab';
g('tbc_0'+i).className='undis';
}
g('tbc_0'+n).className='dis';
g('tb_'+n).className='hovertab';
}
//如果要做成點擊後再轉到請將<li>中的onmouseover 改成 onclick;
</script>
</head>
<body>
<div class="w936">
<div id="tb_" class="tb_">
<ul>
<li id="tb_1" class="hovertab" onmouseover="HoverLi(1);">流行音樂</li>
<li id="tb_2" class="normaltab" onmouseover="HoverLi(2);">美女寫真</li>
<li id="tb_3" class="normaltab" onmouseover="HoverLi(3);">平面設計</li>
<li id="tb_4" class="normaltab" onmouseover="HoverLi(4);">網路學堂</li>
<li id="tb_5" class="normaltab" onmouseover="HoverLi(5);">戀愛寶典</li>
<li id="tb_6" class="normaltab" onmouseover="HoverLi(6);">Q小鴿子</li>
</ul>
</div>
<div class="ctt">
<div class="dis" id="tbc_01">流行音樂 的內容<br />sfsdfasdfsaff</div>
<div class="undis" id="tbc_02">美女寫真 的內容</div>
<div class="undis" id="tbc_03">平面設計 的內容</div>
<div class="undis" id="tbc_04">網路學堂 的內容</div>
<div class="undis" id="tbc_05">戀愛寶典 的內容</div>
<div class="undis" id="tbc_06"><b>桂林天空</b><br /></div>
</div>
</div>
</body>
</html>