-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
64 lines (47 loc) · 1.35 KB
/
index.js
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
window.onload=initPic;
var Pictures=new Array("images/1.jpg","images/2.jpg","images/3.jpg","images/4.jpg","images/5.jpg","images/6.jpg",
"images/7.jpg","images/8.jpg","images/9.jpg","images/10.jpg","images/4.jpg","images/11.jpg","images/12.jpg","images/13.jpg","images/14.jpg"
);
var thisPic=0;
document.getElementById("words").style.opacity="1";
function initPic() {
var autoPlay=setInterval("processNext()","3000");
document.getElementById("img").onmouseover=function(){
clearInterval(autoPlay);
};
document.getElementById("img").onmouseout=function(){
autoPlay=setInterval("processNext()","3000");
};
document.getElementById('prev').onclick=processPrev;
document.getElementById('next').onclick=processNext;
}
function processPrev()
{
if(thisPic==0){
thisPic=Pictures.length;
}
thisPic--;
document.getElementById("img").src=Pictures[thisPic];
return false;
}
function processNext(){
thisPic++;
if(thisPic==Pictures.length){
thisPic=0;
}
document.getElementById("img").src=Pictures[thisPic];
return false;
}
var flag=0;
function bigger(){
if(flag==0){
document.getElementById("img").style.width="600px";
document.getElementById("img").style.height="800px";
flag++;
}
else{
document.getElementById("img").style.width="360px";
document.getElementById("img").style.height="480px";
flag--;
}
}