Jumat, 20 April 2012
Frame dengan Javascript [ Aplikasi IT Part II ] pertemuan ke-7
<html>
<head>
<title>Objek Image</title>
<body>
<script language = "javascript">
<!--
var num = 1
img1 = new Image()
img1.src ="1.jpg"
img2 = new Image()
img2.src ="2.jpg"
img3 = new Image()
img3.src ="3.jpg"
img4 = new Image()
img4.src ="4.jpg"
img5 = new image()
img5.src ="5.jpg"
function slideshow(n)
{
num = num + n
if (num == 5)
{
num = 1
}
if (num == 0)
{
num = 6
}
document.mypic.src=eval("img"+num+".src")
}
//-->
</script>
<center>
<img src = " 1.jpg" name = "mypic" border = 2 height= "300" width = "250">
<br>
<a href = "javascript:slideshow(-1)">Previous</a> -- <a href = "javascript:slideshow(1)">Next</a>
</center>
</body>
</head>
</html>
Langganan:
Posting Komentar (Atom)
Tidak ada komentar:
Posting Komentar