"comparison slider"
Bootstrap 4.1.1 Snippet by Hoss

1
2
3
4
5
6
7
8
9
<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="//code.jquery.com/jquery-1.11.1.min.js"></script>
<!------ Include the above in your HEAD tag ---------->
<div class="juxtapose">
<img src="http://online.wsj.com/media/LIONDOORA.jpg" data-label="2009" alt="" />
<img src="http://online.wsj.com/media/LIONDOOR_2A.jpg" data-label="2014" alt=""/>
</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
.juxtapose {
max-width: 600px;
}
.jx-slider {
margin-top: 1em;
}
div.juxtapose {
width: 100%;
font-family: Helvetica, Arial, sans-serif;
}
div.jx-slider {
width: 100%;
height: 100%;
position: relative;
overflow: hidden;
cursor: pointer;
color: #f3f3f3;
}
div.jx-handle {
position: absolute;
height: 100%;
width: 40px;
cursor: col-resize;
z-index: 15;
margin-left: -20px;
}
.vertical div.jx-handle {
height: 40px;
width: 100%;
cursor: row-resize;
margin-top: -20px;
margin-left: 0;
}
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
/* juxtapose - v1.1.2 - 2015-07-16
* Copyright (c) 2015 Alex Duner and Northwestern University Knight Lab
*/
(function (document, window) {
var juxtapose = {
sliders: [],
OPTIMIZATION_ACCEPTED: 1,
OPTIMIZATION_WAS_CONSTRAINED: 2
};
var flickr_key = "d90fc2d1f4acc584e08b8eaea5bf4d6c";
var FLICKR_SIZE_PREFERENCES = ['Large', 'Medium'];
function Graphic(properties, slider) {
var self = this;
this.image = new Image();
this.loaded = false;
this.image.onload = function() {
self.loaded = true;
slider._onLoaded();
};
this.image.src = properties.src;
this.image.alt = properties.alt || '';
this.label = properties.label || false;
this.credit = properties.credit || false;
}
function FlickrGraphic(properties, slider) {
var self = this;
this.image = new Image();
this.loaded = false;
this.image.onload = function() {
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Related: See More


Questions / Comments: