-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunction_6.html
More file actions
34 lines (34 loc) · 871 Bytes
/
function_6.html
File metadata and controls
34 lines (34 loc) · 871 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script>
var num = 1;
function gallery(direct){
if(direct){
if(num == 8) return;
num++;
}
else{
if(num == 1) return;
num--;
}
var imgTag = document.getElementById("photo");
imgTag.setAttribute("src","images/pic_" + num + ".jpg");
}
</script>
</head>
<body>
<div id="galleryZone">
<p>
<img src="images/pic_1.jpg" id="photo" alt="">
</p>
<p>
<button onclick="gallery(0)">이전</button>
<button onclick="gallery(1)">다음</button>
</p>
</div>
</body>
</html>