-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
50 lines (50 loc) · 1.13 KB
/
index.html
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
38
39
40
41
42
43
44
45
46
47
48
49
50
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Two in one slider demo</title>
<script type="text/javascript" src="twoinone.js"></script>
<script>
window.onload = function(){
var main = document.querySelector('.main');
twoInOneSlider.init(main);
}
</script>
<style>
.main {
width: 200px;
height: 200px;
overflow: hidden;
position: relative;
}
.one {
background-image: url('http://www.lorempixel.com/200/200');
width: 50%;
height: 100%;
}
.two {
background-image: url('http://www.lorempixel.com/200/200/sports');
position: absolute;
left: 0;
right: 0px;
top: 0px;
bottom: 0px;
background-position: right;
}
[data-2in1-separator] {
width: 5px;
top: 0px;
bottom: 0px;
position: absolute;
background-color: red;
}
</style>
</head>
<body>
<div class="main">
<div class="one"></div>
<div class="two"></div>
</div>
</body>
</html>