"Horizontal timeline mockup v2"
Bootstrap 4.1.1 Snippet by ranjit1602

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="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<!------ Include the above in your HEAD tag ---------->
<div id="container">
<div id="thumbs">
<div class="history-block bg-66">
<div class="cover"></div>
<div class="year">1966 - 1976</div>
<div class="title">Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam</div>
<div class="timeline">
<ul>
<li><a href="" class="timelineYear">1966</a></li>
<li><a href="" class="timelineYear">1967</a></li>
<li><a href="" class="timelineYear">1968</a></li>
<li><a href="" class="timelineYear">1969</a></li>
<li><a href="" class="timelineYear">1970</a></li>
<li><a href="" class="timelineYear">1971</a></li>
<li><a href="" class="timelineYear">1972</a></li>
<li><a href="" class="timelineYear">1973</a></li>
<li><a href="" class="timelineYear">1974</a></li>
<li><a href="" class="timelineYear">1975</a></li>
<li><a href="" class="timelineYear">1976</a></li>
</ul>
</div>
</div>
<div class="history-block bg-76">
<div class="cover"></div>
<div class="year">1976 - 1986</div>
<div class="title">Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam</div>
<div class="timeline">
<ul>
<li><a href="" class="timelineYear">1976</a></li>
<li><a href="" class="timelineYear">1977</a></li>
<li><a href="" class="timelineYear">1978</a></li>
<li><a href="" class="timelineYear">1979</a></li>
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
*{margin: 0;padding: 0;}
body {
background: #ddd;
}
#container
{
height: 600px;
width: 100%;
background-color: #ddd;
overflow: hidden;
position: relative;
#overflow-x: scroll;
margin-top: 30px;
display: inline-block;
}
#thumbs
{
background-color: #ddd;
position: absolute;
top: 0px;
left: 0px;
height: 100%;
width: auto;
overflow: hidden;
white-space: nowrap;
padding: 30px 100px;
}
.history-block {
height: 100%;
width: 300px;
background-color: #cdcdcd;
margin: 0 -2px;
border-right: 1px solid #fff;
display: inline-block;
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
var viewportWidth, divWidth, tb;
$(function() {
viewport = $('#container').innerWidth();
tb = $('#thumbs');
divWidth = tb.outerWidth();
$('#container').mousemove(function(e)
{
tb.css({left: ((viewport - divWidth)*((e.pageX / viewport).toFixed(3))).toFixed(1) +"px" });
});
$('.history-block').on('click', function(){
$('.history-block').css('width', '300px');
$('.history-block').find('.title').css('width', '260px');
$('.history-block .timeline').hide(300);
$(this).css('width', '600px');
$(this).find('.title').css('width', '500px');
$(this).find('.timeline').show(800);
$('#container').mousemove(function(e)
{
tb.css({left: ((viewport - divWidth-300)*((e.pageX / viewport).toFixed(3))).toFixed(1) + 300 + "px" });
});
});
$('.timeline ul li').on('click', function(){
$(this).parent().blink();
});
});
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Related: See More


Questions / Comments: