Blogger Information
Blog 4
fans 0
comment 0
visits 3089
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
tab切换效果
syqaily的博客
Original
790 people have browsed it
<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<style>
			body,ul{ margin: 0; padding: 0;}
			li{list-style: none;}
			a{text-decoration: none;}
			.clearfix:after{content: ""; display: block; clear: both;}
			.clearfix{zoom: 1;}
			#list{width: 400px; margin: 100px auto 0; font-size: 14px; font-family: "微软雅黑";}
			#list>li{width: 100px; background: #ccc; float: left;}
			#list .active{background: red;}
			#list a{color: #333;display: block;}
			#list li{height: 30px; line-height: 30px; text-align: center;}
			#list ul{display: none;}
			#list ul li{width: 120px; background: green; margin-bottom: 5px;}
			#list ul li:hover{background: yellow;}
		</style>
	</head>
	<body>
		 <ul id="list" class="clearfix">
		 	<li class="active">
		 		<a href="">登录</a>
		 	  <ul style="display: block;">
		 		<li><a href="">11</a></li>
		 		<li><a href="">22</a></li>
		 		<li><a href="">33</a></li>
		 		<li><a href="">44</a></li>
		 	  </ul>
		 	</li>
		 	<li>
		 		<a href="">微博</a>
		 	   <ul>
		 		<li><a href="">11</a></li>
		 		<li><a href="">22</a></li>
		 		<li><a href="">33</a></li>
		 		<li><a href="">44</a></li>
		 		</ul>
		 	</li>
		 	<li>
		 		<a href="">博客</a>
		 	  <ul>
		 		<li><a href="">11</a></li>
		 		<li><a href="">22</a></li>
		 		<li><a href="">33</a></li>
		 		<li><a href="">44</a></li>
		 		</ul>
		 	</li>
		 	<li>
		 		<a href="">邮箱</a>
		 	   <ul>
		 		<li><a href="">11</a></li>
		 		<li><a href="">22</a></li>
		 		<li><a href="">33</a></li>
		 		<li><a href="">44</a></li>
		 		</ul>
		 	</li>
		 </ul>
		 <script>
		 	var oList=document.getElementById('list');
		 	var aLi=oList.children;
		 	var aUl=oList.getElementsByTagName('ul');
		 	var len=aLi.length;
		 	for(var i=0;i<len;i++){
		 		aLi[i].index=i;
		 		aLi[i].onmouseover=function(){
		 			for(var i=0;i<len;i++){
		 				aLi[i].className='';
		 				aUl[i].style.display='none';
		 			}
		 			   this.className='active';
		 			   aUl[this.index].style.display='block';
		 		}
		 	}
		 </script>
	</body>
</html>


Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post