forked from luwes/js-cover-flow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
102 lines (92 loc) · 2.85 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
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Cover Flow</title>
<link rel="stylesheet" href="coverflow.css"/>
</head>
<body>
<div id="container"></div>
<!--<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>-->
<script src="coverflow.js"></script>
<script>
function reset() {
coverflow('container').remove();
//$('#container').coverflow({
coverflow('container').setup({
width: '100%',
item: 1,
//mousewheel: false,
//mode: "flash",
//backgroundcolor: '009900',
//backgroundopacity: 0,
//wmode: 'transparent',
//gradientcolor: 'ff0000',
//showduration: true,
playlist: "playlist.json",
//preventslideback: false,
//slidespeed: 2,
//playlist: "http://api.flickr.com/services/feeds/groups_pool.gne?id=807213@N20&format=json&jsoncallback=?",
//route: {
// playlist: "items",
// image: "media.m"
//},
// playlist: [
// {
// "title": "snow-motion",
// "description": "what a massive and unbelievable winter we're having!",
// "image": "http://d3el35u4qe4frz.cloudfront.net/eawtAP1q-720.jpg",
// "link": "http://www.google.com/",
// "duration": "183"
// },
// {
// "title": "driving rain",
// "description": "",
// "image": "http://d3el35u4qe4frz.cloudfront.net/njZMLMwy-720.jpg",
// "duration": "782"
// },
// {
// "title": "winter brook",
// "description": "",
// "image": "http://d3el35u4qe4frz.cloudfront.net/Vg7cPUdl-720.jpg"
// }
// ],
coverwidth: 180,
coverheight: 150,
fixedsize: true,
textoffset: 50
})
.on('ready', function() {
this.on('focus', function(index) {
document.getElementById('focusindex').innerHTML = index;
});
this.on('click', function(index, link) {
document.getElementById('clickindex').innerHTML = index;
console.log(link);
if (link) {
window.open(link, '_blank');
}
});
});
}
reset();
</script>
<div style="width:480px;">
<div style="float:right;">Focused: <b id="focusindex">0</b> | Clicked: <b id="clickindex">0</b></div>
<p>
<a href="javascript:;" onclick="coverflow().left();">Left</a> - <a href="javascript:;" onclick="coverflow().right();">Right</a>
</p>
<p>
<a href="javascript:;" onclick="coverflow().prev();">Previous</a> - <a href="javascript:;" onclick="coverflow().next();">Next</a>
</p>
<p>
<input id="toval" value="0" size="1"> <a href="javascript:;" onclick="coverflow().to(document.getElementById('toval').value);">To</a>
</p>
<p>
<a href="javascript:;" onclick="coverflow().fadeIn(function(){console.log(900);});">Fade in</a> - <a href="javascript:;" onclick="coverflow().fadeOut();">Fade out</a>
</p>
</div>
<button onclick="reset();">Reset</button>
<button onclick="coverflow().remove();">Remove</button>
</body>
</html>