-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathevent2.html
45 lines (37 loc) · 1.18 KB
/
event2.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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title> Image Guess </title>
<style> body { margin: 20px; }</style>
<script>
window.onload = init;
function init(){
var images = document.getElementsByTagName("img");
for(var i = 0; i < images.length; i++){
images[i].onclick = showAnswer;
}
}
function showAnswer(eventObj){
var image = eventObj.target;
var name = image.id;
name = name + ".jpg";
image.src = name;
setTimeOut(reblur, 2000, image);
}
function reblur(image){
var name = image.id;
name = name + "blur.jpg";
image.src = name;
}
</script>
</head>
<body>
<img id="zero" src="zeroblur.jpg">
<img id="one" src="oneblur.jpg">
<img id="two" src="twoblur.jpg">
<img id="three" src="threeblur.jpg">
<img id="four" src="fourblur.jpg">
<img id="five" src="fiveblur.jpg">
</body>
</html>