WEB简单通用的选项卡效果

WEB简单通用的选项卡效果  效果图:

代码如下:

 

<!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>animate tabs</title>

	<script type="text/javascript" src="http://www.ihiro.org/cases/js/jquery-1.3.2.min.js"></script>       
    <style type="text/css">
		* { margin:0; padding:0;}
		body { font:12px Verdana, Geneva, sans-serif; color:#404040;}
		/*
		.tabs { margin:10px 0 0 20px; width:360px; position:relative; overflow:hidden; height:1%; height:140px;}
		.tabs h3 { z-index:2; font-size:12px; background:url(http://www.ihiro.org/cases/tabs/pic.gif) no-repeat; width:95px; height:25px; line-height:25px; text-align:center; float:left; margin-right:5px;}
		h3.active { background-position:0 -25px; color:#fff;}
		h3.over{cursor:pointer;}
		#tab-01, #tab-02, #tab-03 { position:absolute; top:24px; left:0; width:338px; padding:10px; height:93px; border:1px solid #ace; z-index:1;}
		#tab-02, #tab-03 { display:none;}
		*/
		
			.tabs { margin:10px 0 0 20px; width:600px; position:relative; overflow:hidden; height:1%; height:400px;  background-color:#F66}
		.tabs h3 { z-index:2; font-size:12px; background:url(http://www.ihiro.org/cases/tabs/pic.gif) no-repeat; width:95px; height:25px; line-height:25px; text-align:center; float:left; margin-right:5px;}
		h3.active { background-position:0 -25px; color:#fff;}
		h3.over{cursor:pointer;}
		#tab-01, #tab-02, #tab-03 { position:absolute; top:24px; left:0; width:580px; padding:10px; height:350px; border:1px solid #ace; z-index:1;}
		#tab-02, #tab-03 { display:none;}
    </style>
    <script type="text/javascript">
	$(document).ready(function() {
		$('.tabs h3').mouseover(function(){$(this).siblings('h3').addClass('over');})
		.click(function() {
			$('.tabs div').hide();
			$(this).siblings('h3').removeClass('active').end()
								  .addClass('active').next('div').show();
		});		
	});
    </script>
</head>
<body>
	<div class="tabs">
    	<!-- 默认第一个tab为激活状态 -->
        <h3 class="active"><span>热点新闻</span></h3>
        <div id="tab-01">news</div>
	    <h3><span>娱乐新闻</span></h3>
        <div id="tab-02">enteriment</div>
        <h3><span>就业形势</span></h3>
        <div id="tab-03">jobs</div>
    </div>
</body>
</html>


 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值