下载: http://sc.chinaz.com/jiaoben/131112181390.htm
其它: http://sc.chinaz.com/tag_jiaoben/shijianzhou.html
效果:
html 代码:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="css/about.css">
<style>
.page { width:100%;background:#F0F0F0 url('img/dian2.png') repeat-x; }
</style>
<title>大事记jQuery时间轴</title>
</head>
<body>
<div class="page">
<div class="header">
</div> <div class="box">
<ul class="event_year">
<li class="current"><label for="2013">2013</label></li>
<li><label for="2012">2012</label></li> </ul>
<ul class="event_list">
<div>
<h3 id="2013">2013</h3>
<li>
<span>5月26日</span>
<p><span>站长之家专栏改版上线</span></p>
</li>
<li>
<span>4月</span>
<p><span>站长工具旗下产品,超级监控上线</span></p>
</li>
</div>
<div>
<h3 id="2012">2012</h3>
<li>
<span>9月</span>
<p><span>站长之家北京分公司成立</span></p>
</li> </div> </ul>
<div class="clearfix"></div> </div>
</div>
<script src="js/jquery.min_v1.0.js" type="text/javascript"></script>
<script>
$(function(){
$('label').click(function(){
$('.event_year>li').removeClass('current');
$(this).parent('li').addClass('current');
var year = $(this).attr('for');
$('#'+year).parent().prevAll('div').slideUp(800);
$('#'+year).parent().slideDown(800).nextAll('div').slideDown(800);
});
});
</script>
<div style="text-align:center;clear:both">
<p>适用浏览器:IE8、360、FireFox、Chrome、Safari、Opera、傲游、搜狗、世界之窗.</p>
</div>
</body>
</html>
ok