-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
78 lines (72 loc) · 2.28 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<script>!window.jQuery && document.write('<script src="js/jquery.js"><\/script>')</script>
<script src="js/jquery.animate.rotate.js"></script>
<script src="js/jquery.css.transform.patch.js"></script>
<script src="js/jquery.devroulette.js"></script>
<style type="text/css">
* { margin:0; padding:0; }
#spinner { position:relative; }
#spinner .boxparent {
width:100%;
height:100%;
position:absolute;
}
#spinner .box {
width: 100px;
height:60px;
overflow:hidden;
position:absolute;
}
#spinner img { width:120px; height:auto }
</style>
<script type="text/javascript">
$(document).ready(function() {
$('#spinner').devRoulette({
speed:1500,
next :'#n',
prev :'#p'
});
});
</script>
</head>
<body>
<div id="spinner">
<div class="box"><img src="img/1.jpg"/></div>
<div class="box"><img src="img/2.jpg"/></div>
<div class="box"><img src="img/2.jpg"/></div>
<div class="box"><img src="img/2.jpg"/></div>
<div class="box"><img src="img/2.jpg"/></div>
<div class="box"><img src="img/2.jpg"/></div>
<div class="box"><img src="img/3.jpg"/></div>
<div class="box"><img src="img/3.jpg"/></div>
</div>
<div id="n">next</div>
<div id="p">prev</div>
<h2>todo</h2>
<p>add start position</p>
<p>auto play</p>
<h2>replanning plugin selectors</h2>
<pre>
html structure :
#idcontainer
div: overflow:hidden, to control image auto sizing
jquery dom actions:
variables-
- obj = selctor
- box = selector .child
- bh = box.height
- bw = box.width
> box.length ~ find the number of boxes
> find width/height of the box
> .box.wrap(.spin:width:diameter;height:diameter;) ~ spin div should be same dimension with obj (calculated by diameter)
ideas:
shorten html to only just selector>img
bh and bw are defined in the options
and wrap the img with .spin and .box with options of o.bw, o.bh
</pre>
</body>
</html>