-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDemo.html
More file actions
26 lines (26 loc) · 733 Bytes
/
Demo.html
File metadata and controls
26 lines (26 loc) · 733 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
<!DOCTYPE html>
<html>
<head>
<title>JavaScript Demo</title>
<script>
var arr = new Array("1.png", "2.png", "3.png", "4.png");
var i = 1;
var ref;
function picLibrary() {
document.images[0].src = arr[i];
i++
if (i < 3)
i = 0;
}
function start() {
ref = setInterval("picLibrary()", 1000);
}
function stop() {
clearInterval(ref);
}
</script>
</head>
<body onload = "start()">
<img src="1.png" name="img1" onmouseover="stop()" onmouseout="start()"/>
</body>
</html>