-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjavascript.js
More file actions
67 lines (41 loc) · 870 Bytes
/
javascript.js
File metadata and controls
67 lines (41 loc) · 870 Bytes
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
var currentImg = 0;
var maxImgs = 4;
var timeOutId;
/*build autorotation for every 3.5 seconds */
function showNext() {
if (currentImg < maxImgs){
return currentImg++
} else {
return currentImg = 0;
};
}
function autoRotateImg(currentImg){
var paneLeft = document.getElementById("panes");
switch (currentImg) {
case 1:
paneLeft.style.left = "-100%";
break;
case 2:
paneLeft.style.left = "-200%";
break;
case 3:
paneLeft.style.left = "-300%";
break;
case 4:
paneLeft.style.left = "-400%";
break;
default:
paneLeft.style.left = "0";
};
};
function autoRotate() {
showNext();
autoRotateImg();
timeOutId = window.setTimeout(autoRotate, 3000);
};
function PromptTest(){
alert("I worked!");
};
/* rotate image to before (left arrow) */
/*rotate image to next img (right arrow) */
/*match up buttons with img in array */