"Timeline (with images and tooltip)"
Bootstrap 3.0.3 Snippet by rafamaciel

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.3/js/bootstrap.min.js"></script>
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<!------ Include the above in your HEAD tag ---------->
<div class="container">
<div class="page-header text-center">
<h1 id="timeline">Timeline 2.0</h1>
</div>
<ul class="timeline">
<li>
<div class="timeline-badge primary"><a><i class="glyphicon glyphicon-record" rel="tooltip" title="11 hours ago via Twitter" id=""></i></a></div>
<div class="timeline-panel">
<div class="timeline-heading">
<img class="img-responsive" src="http://lorempixel.com/1600/500/sports/2" />
</div>
<div class="timeline-body">
<p>Mussum ipsum cacilds, vidis litro abertis. Consetis adipiscings elitis. Pra lá , depois divoltis porris, paradis. Paisis, filhis, espiritis santis. Mé faiz elementum girarzis, nisi eros vermeio, in elementis mé pra quem é amistosis quis leo. Manduma pindureta quium dia nois paga. Sapien in monti palavris qui num significa nadis i pareci latim. Interessantiss quisso pudia ce receita de bolis, mais bolis eu num gostis.</p>
</div>
<div class="timeline-footer">
<a><i class="glyphicon glyphicon-thumbs-up"></i></a>
<a><i class="glyphicon glyphicon-share"></i></a>
<a class="pull-right">Continuar Lendo</a>
</div>
</div>
</li>
<li class="timeline-inverted">
<div class="timeline-badge primary"><a><i class="glyphicon glyphicon-record invert" rel="tooltip" title="11 hours ago via Twitter" id=""></i></a></div>
<div class="timeline-panel">
<div class="timeline-heading">
<img class="img-responsive" src="http://lorempixel.com/1600/500/sports/2" />
</div>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
.timeline {
list-style: none;
padding: 20px 0 20px;
position: relative;
}
.timeline:before {
top: 0;
bottom: 0;
position: absolute;
content: " ";
width: 3px;
background-color: #eeeeee;
left: 50%;
margin-left: -1.5px;
}
.timeline > li {
margin-bottom: 20px;
position: relative;
}
.timeline > li:before,
.timeline > li:after {
content: " ";
display: table;
}
.timeline > li:after {
clear: both;
}
.timeline > li:before,
.timeline > li:after {
content: " ";
display: table;
}
.timeline > li:after {
clear: both;
}
.timeline > li > .timeline-panel {
width: 46%;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
3
4
5
6
7
8
9
10
11
12
13
$(document).ready(function(){
var my_posts = $("[rel=tooltip]");
for(i=0;i<my_posts.length;i++){
the_post = $(my_posts[i]);
if(the_post.hasClass('invert')){
the_post.tooltip({ placement: 'left'});
the_post.css("cursor","pointer");
}else{
the_post.tooltip({ placement: 'rigt'});
the_post.css("cursor","pointer");
}
}
});
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Related: See More


Questions / Comments:

is it possible to have a single column timeline using this snippet? I don't really need the left column..

scale () - 10 years ago - Reply 0


I had made a few changes to reduce the empty spaces, the code that needed to be changed is the follwoing:

.timeline:before {
top: 0;
bottom: 0;
position: absolute;
content: " ";
width: 3px;
background-color: #eeeeee;
left: 50%;
margin-left: -1.5px;
}
.timeline > li {
margin-bottom: 20px;
position: relative;
width: 50%;
float: left;
clear: left;
}
.timeline > li > .timeline-panel {
width: 95%;
float: left;
border: 1px solid #d4d4d4;
/*border-radius: 2px;*/
/*padding: 20px;*/
position: relative;
-webkit-box-shadow: 0 1px 6px rgba(0, 0, 0, 0.175);
box-shadow: 0 1px 6px rgba(0, 0, 0, 0.175);
}
.timeline > li.timeline-inverted{
float: right;
clear: right;
margin-top: 30px;
margin-bottom: 30px;
}
.timeline > li:nth-child(2){
margin-top: 60px;
}
.timeline > li.timeline-inverted > .timeline-badge{
left: -12px;
}

And i add
<li class="clearfix" style="float: none;"></li>
to the html so the middle line go until the end of <li>
-------------------------------------------------------------------------
All the rest of the code remains the same.

Sr Patinhas () - 10 years ago - Reply 0


Great snippet but... too many empty space between events

linuxonrails () - 11 years ago - Reply 0


If you want, i had post a few changes to remove the empty spaces.

Sr Patinhas () - 10 years ago - Reply 0


how can we avoid multiple scroll bars around the timeline container in chrome?

Ameenullah () - 11 years ago - Reply 0