-
Notifications
You must be signed in to change notification settings - Fork 69
/
index.html
executable file
·142 lines (130 loc) · 4.34 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
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Waterwheel Carousel Demo</title>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="js/jquery.waterwheelCarousel.js"></script>
<script type="text/javascript">
$(document).ready(function () {
var carousel = $("#carousel").waterwheelCarousel({
flankingItems: 3,
movingToCenter: function ($item) {
$('#callback-output').prepend('movingToCenter: ' + $item.attr('id') + '<br/>');
},
movedToCenter: function ($item) {
$('#callback-output').prepend('movedToCenter: ' + $item.attr('id') + '<br/>');
},
movingFromCenter: function ($item) {
$('#callback-output').prepend('movingFromCenter: ' + $item.attr('id') + '<br/>');
},
movedFromCenter: function ($item) {
$('#callback-output').prepend('movedFromCenter: ' + $item.attr('id') + '<br/>');
},
clickedCenter: function ($item) {
$('#callback-output').prepend('clickedCenter: ' + $item.attr('id') + '<br/>');
}
});
$('#prev').bind('click', function () {
carousel.prev();
return false
});
$('#next').bind('click', function () {
carousel.next();
return false;
});
$('#reload').bind('click', function () {
newOptions = eval("(" + $('#newoptions').val() + ")");
carousel.reload(newOptions);
return false;
});
});
</script>
<style type="text/css">
body {
font-family:Arial;
font-size:12px;
background:#ededed;
}
.example-desc {
margin:3px 0;
padding:5px;
}
#carousel {
width:960px;
border:1px solid #222;
height:300px;
position:relative;
clear:both;
overflow:hidden;
background:#FFF;
}
#carousel img {
visibility:hidden; /* hide images until carousel can handle them */
cursor:pointer; /* otherwise it's not as obvious items can be clicked */
}
.split-left {
width:450px;
float:left;
}
.split-right {
width:400px;
float:left;
margin-left:10px;
}
#callback-output {
height:250px;
overflow:scroll;
}
textarea#newoptions {
width:430px;
}
</style>
</head>
<body>
<h1>Carousel Demo</h1>
<div id="carousel">
<img src="images/1.jpg" id="item-1" />
<img src="images/2.jpg" id="item-2" />
<img src="images/3.jpg" id="item-3" />
<img src="images/4.jpg" id="item-4" />
<img src="images/5.jpg" id="item-5" />
<img src="images/6.jpg" id="item-6" />
<img src="images/7.jpg" id="item-7" />
<img src="images/8.jpg" id="item-8" />
<img src="images/9.jpg" id="item-9" />
</div>
<a href="#" id="prev">Prev</a> | <a href="#" id="next">Next</a>
<br/>
<div class="split-left">
<h2>Set Options (<a href="http://www.bkosborne.com/jquery-waterwheel-carousel/options" target="_blank">view available options</a>)</h2>
<p>You can set new options for the carousel here. Once you are satisified with the appearance of the carousel, just copy and paste the options into your own implementation.</p>
<textarea id="newoptions" rows="15">
{
flankingItems: 3,
movingToCenter: function ($item) {
$('#callback-output').prepend('movingToCenter: ' + $item.attr('id') + '<br/>');
},
movedToCenter: function ($item) {
$('#callback-output').prepend('movedToCenter: ' + $item.attr('id') + '<br/>');
},
movingFromCenter: function ($item) {
$('#callback-output').prepend('movingFromCenter: ' + $item.attr('id') + '<br/>');
},
movedFromCenter: function ($item) {
$('#callback-output').prepend('movedFromCenter: ' + $item.attr('id') + '<br/>');
},
clickedCenter: function ($item) {
$('#callback-output').prepend('clickedCenter: ' + $item.attr('id') + '<br/>');
}
}
</textarea><br/>
<a href="#" id="reload">Reload New Options</a>
</div>
<div class="split-right">
<h2>Sample callback output</h2>
<div id="callback-output">
</div>
</div>
</body>
</html>