<!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" />
<meta http-equiv="content-language" content="zh-cn" />
<meta name="author" content="forfor" />
<meta name="keywords" content="" />
<title> Tab Demo </title>
<script type="text/javascript">
<!--
function c(i){
var i;
document.getElementById("tab").className="tabD"+i;
window.name=i;//window.name版
}
onload=function(){
var a=document.links;
for(var i=0;i<a.length;i++)a[i].onfocus=function(){this.blur();}
}
//-->
</script>
<style type="text/css">
body,table,td,th,input,textarea,button,select{font:13px Verdana,"宋体",sans-serif;}
body{background-color:#eef;}
div#tab{width:300px;text-align:left;}
ul.tabU{
list-style: none;
margin: 0px;
padding:1px 0px 0px .5em;
}
ul.tabU li{
display: inline;
margin-right:2px;
}
ul.tabU li a{
border-left:1px solid #BBBBBB; border-right:1px solid #BBBBBB; border-top:1px solid #BBBBBB; border-bottom:0px solid #BBBBBB; color:black;
font-weight:bold;
line-height: 20px;
text-decoration:none;
background-image: url('tab.gif');
cursor: pointer; padding-left:5px; padding-right:5px; padding-top:0px; padding-bottom:2px
}
div.tabC{
display:none;
border:1px solid;
padding:6px;
}
div.tabD1 a.tabB1,a.tabB1:hover{background-position:0 -20px;border-color:#EAAD6B;}
div.tabD1 div.tabC1{border-color:#EAAD6B;display:block;background-color:#FDEDD8;}
div.tabD2 a.tabB2,a.tabB2:hover{background-position:0 -42px;border-color:#6ECEF3;}
div.tabD2 div.tabC2{border-color:#6ECEF3;display:block;background-color:#E6F6FD;}
div.tabD3 a.tabB3,a.tabB3:hover{background-position:0 -64px;border-color:#84AC44;}
div.tabD3 div.tabC3{border-color:#84AC44;display:block;background-color:#F1F6E7;}
div.tabD4 a.tabB4,a.tabB4:hover{background-position:0 -86px;border-color:#F37CA3;}
div.tabD4 div.tabC4{border-color:#F37CA3;display:block;background-color:#FFEEF4;}
div.tabD1 a.tabB1,div.tabD2 a.tabB2,div.tabD3 a.tabB3,div.tabD4 a.tabB4{padding:1px 5px 3px;}
</style>
</head>
<body>
<center>
<div id="tab" class="tabD1">
<script type="text/javascript">
<!--
//var i=parseInt(location.hash.replace("#",""));//hash版
var i=parseInt(window.name);//window.name版
if(i)document.getElementById("tab").className="tabD"+i;
//-->
</script>
<ul class="tabU">
<li><a onclick="c(1)" href="#1" class="tabB1">tab1</a></li><li><a onclick="c(2)" href="#2" class="tabB2">tab2</a></li><li><a onclick="c(3)" href="#3" class="tabB3">tab3</a></li><li><a onclick="c(4)" href="#4" class="tabB4">tab4</a></li>
</ul>
<div class="tabC tabC1"><b>Tab Demo</b> Ver1.2(window.name)<br/>Created by forfor 2006-09-12</div>
<div class="tabC tabC2"><input value="hello"/></div>
<div class="tabC tabC3"><center><img alt="google" src="logo.gif"/></center></div>
<div class="tabC tabC4">ver1.0 2005-09-09<br/>ver1.1 2005-09-14<br/>ver1.2 2006-09-12<br/><a href="javascript:void(c(0));">......</a></div>
</div>
</center>
</body>
</html>
posted on 2006-10-29 03:09
汪杰 阅读(426)
评论(0) 编辑 收藏 引用 所属分类:
js+dhtml