-
Notifications
You must be signed in to change notification settings - Fork 0
/
gallery.php
51 lines (43 loc) · 1.44 KB
/
gallery.php
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
<html>
<head>
<title>
</title>
<script type="text/javascript">
var images=['ax/1_p.jpg','ax/2_p.jpg','ax/3_p.jpg','ax/4_p.jpg','ax/5_p.jpg','ax/6_p.jpg','ax/7_p.jpg'];
function nextImage() {
var img = document.getElementById("slideimage");
var imgname = img.name.split("_");
var index = imgname[1];
if (index == images.length - 1) {
index = 0;
} else {
index++;
}
document.getElementById('slideimage').src = images[index];
img.name = "image_" + index;
}
function prevImage() {
var img = document.getElementById("slideimage");
var imgname = img.name.split("_");
var index = imgname[1];
if (index == 0) {
index = images.length - 1;
} else {
index--;
}
img.src = images[index];
img.name = "image_" + index;
}
function x(){
setInterval("nextImage()",3000);
}
</script>
</head>
<body onLoad="x();">
<div style="margin:30px auto; width:30%; height:30%;text-align:center;">
<p><img title="محمد قبادی" alt="محمد قبادی" id="slideimage" name="image_0" src="ax/1_p.jpg"></p>
<button onClick="prevImage();"> Previous </button>
<button onClick="nextImage();"> Next </button>
</div>
</body>
</html>