-
Notifications
You must be signed in to change notification settings - Fork 1
/
demo.html
117 lines (109 loc) · 3.54 KB
/
demo.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
<!DOCTYPE html>
<html>
<head>
<title>Carousel.js Demo</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
</head>
<body>
<div id="test" style="width: 100%; height: 200px;"></div>
<div id="test2" style="width: 100%; height: 200px;"></div>
<div id="test3" style="width: 100%; height: 200px;"></div>
<style>
ul.slider, body {
margin: 0;
border: 0;
padding: 0;
font-size: 0;
list-style-type: none;
}
ul.slider li {
font-size: 30px;
height: 100%;
}
ul.slider li img {
width: 100%;
height: 100%;
pointer-events: none;
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
</style>
<script type="text/javascript" src="bower_components/jquery/jquery.js"></script>
<script type="text/javascript" src="bower_components/lodash/dist/lodash.js"></script>
<script type="text/javascript" src="bower_components/eventEmitter/EventEmitter.js"></script>
<script type="text/javascript" src="bower_components/eventie/eventie.js"></script>
<script type="text/javascript" src="bower_components/imagesloaded/imagesloaded.js"></script>
<script type="text/javascript" src="carousel.js"></script>
<script type="text/javascript">
$(function() {
_.defer(function () {
var carousel = new Carousel({
el: '#test',
pageWidth: 128,
manageImages: true,
data: [
{ url: 'http://placehold.it/128x200/D5FBFF' },
{ url: 'http://placehold.it/128x200/9FBCBF' },
{ url: 'http://placehold.it/128x200/647678' },
{ url: 'http://placehold.it/128x200/2F3738' },
{ url: 'http://placehold.it/128x200/59D8E6' },
],
template: function (data, options) {
if (data && data.url) {
return '<img src="' + data.url + '" />';
}
return '';
}
});
var carousel2 = new Carousel({
el: '#test2',
pageWidth: 128,
snap: true,
manageImages: true,
data: [
{ url: 'http://placehold.it/128x200/85DB18' },
{ url: 'http://placehold.it/128x200/CDE855' },
{ url: 'http://placehold.it/128x200/F5F6D4' },
{ url: 'http://placehold.it/128x200/A7C520' },
{ url: 'http://placehold.it/128x200/493F0B' },
],
template: function (data, options) {
if (data && data.url) {
return '<img src="' + data.url + '" />';
}
return '';
}
});
var carousel3 = new Carousel({
el: '#test3',
pageWidth: 128,
loop: false,
overscroll: true,
snapNearest: true,
manageImages: true,
data: [
{ url: 'http://placehold.it/128x200/DC3522' },
{ url: 'http://placehold.it/128x200/D9CB9E' },
{ url: 'http://placehold.it/128x200/374140' },
{ url: 'http://placehold.it/128x200/2A2C2B' },
{ url: 'http://placehold.it/128x200/1E1E20' },
],
template: function (data, options) {
if (data && data.url) {
return '<img src="' + data.url + '" />';
}
return '';
}
});
carousel.render();
carousel2.render();
carousel3.render();
});
});
</script>
</body>
</html>