利用Jquery实现几款漂亮实用的时间轴(附示例代码)

2020-05-19 07:42:16易采站长站整理

font-size: 100%;
vertical-align: baseline;
background: transparent;
}

a {
color: #007bc4 /*#424242*/;
text-decoration: none;
}

a:hover {
text-decoration: underline;
}

ol, ul {
list-style: none;
}

table {
border-collapse: collapse;
border-spacing: 0;
}

body {
height: 100%;
font: 12px/18px Tahoma, Helvetica, Arial, Verdana, "5b8b4f53", sans-serif;
color: #51555C;
background: #D3D3D3;
}

img {
border: none;
}

#main {
width: 550px;
min-height: 400px;
margin: 30px auto 0 auto;
background: #fff;
-moz-border-radius: 12px;
-khtml-border-radius: 12px;
-webkit-border-radius: 12px;
border-radius: 12px;
margin-left:5px;
}

h2.top_title {
margin: 4px 20px;
padding-top: 15px;
padding-left: 20px;
padding-bottom: 10px;
border-bottom: 1px solid #d3d3d3;
font-size: 18px;
color: #a84c10;
background: url(../images/arrL.gif) no-repeat 2px 14px;
}

3、HTML代码


<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>横向时间轴</title>
<link rel="stylesheet" type="text/css" href="css/main.css" />
<style type="text/css">
#timeline {
width: 500px;
height: 300px;
overflow: hidden;
margin: 100px auto;
position: relative;
background: url('img/dot.gif') left 45px repeat-x;
}

#dates {
width: 760px;
height: 60px;
overflow: hidden;
}

#dates li {
list-style: none;
float: left;
width: 180px;
height: 50px;
font-size: 24px;
text-align: center;
background: url('img/biggerdot.png') center bottom no-repeat;
}

#dates a {
width:180px;
line-height: 20px;
padding-bottom: 2px;
font-size: 15px;
}

#dates .selected {
font-size: 20px;
font-weight:bold;
}

#issues {
width: 760px;
height: 300px;
overflow: hidden;
}

#issues li {
width: 760px;
height: 300px;
list-style: none;
float: left;
}

#issues li h3 {
color: #ffcc00;
font-size: 35px;
margin: 20px 0;
}

#issues li p {
font-size: 14px;
margin-right: 70px;
margin: 10px;
font-weight: normal;
line-height: 22px;
}
</style>
<script type="text/javascript" src="js/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="js/jquery.timelinr-0.9.53.js"></script>
<script type="text/javascript">
$(function () {
$().timelinr({
autoPlay: 'true',