-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
61 lines (46 loc) · 1.71 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
<!---
This files demonstrates basic use of the plugin.
It also contains a simple function for easy iteration over a folder of images. See usage below.
-->
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/mootools/1.4.0/mootools-yui-compressed.js" type="text/javascript"></script>
<script src="script/mootools-more-1.3.2.1.js" type="text/javascript"></script>
<script src="script/mooRotate360.js" type="text/javascript"></script>
<script type="text/javascript">
window.addEvent('domready',function()
{
/*
createImageArray function
This function takes an imageprefix and number of images to create an array of URL's that can be parsed into the mooRotate360 Class.
It is used here to avoid having to manually enter all the URL's into an array, which would be tedious and ugly.
*/
var createImageArray = function(prefix, from, to){
var result = [];
for(var i=from;i<to+1;i++){
var index = "";
if(i < 10){
index = "0" + i
}else{
index = "" + i
}
result.push(prefix + index + ".jpg");
}
return result;
}
// Running images URL's through the createImageArray function and loading them into arrays.
var yoda_images = createImageArray("images/yoda/img", 1, 36);
var iphone_images = createImageArray("images/iphone/img", 1, 36);
var shoe_images = createImageArray("images/shoe/img", 1, 36);
// The actual mooRotate360 code.
new mooRotate360( yoda_images, $("wrapper"), {tickAmount:12, autoPlay:false, frameTime:100});
new mooRotate360( iphone_images, $("wrapper"), {tickAmount:12, autoPlay:false, frameTime:100});
new mooRotate360( shoe_images, $("wrapper") , {tickAmount:12, autoPlay:false, frameTime:100});
});
</script>
</head>
<body>
<div id="wrapper">
</div>
</body>
</html>