[ JS ]
/* This script and many more are available free online at The JavaScript Source!! http://javascript.internet.com Created by: Jay M. Rumsey, OD | http://www.nova.edu/~rumsey */
var num=0;
imgArray = [ ['image/01.jpg','information', 'The beautiful mountains'], ['image/02.jpg','interference','The crystal clear lake'], ['image/03.jpg','message','The lonesome, barren tree'] //À̹ÌÁö°æ·Î ]
function slideshow(slide_num) { document.getElementById('mypic').src=imgArray[slide_num][0]; document.getElementById('mypic').alt=imgArray[slide_num][1]; document.getElementById('burns').innerHTML=imgArray[slide_num][2]; }
function slideshowUp() { num++; num = num % imgArray.length; slideshow(num); }
function slideshowBack() { num--; if (num < 0) {num=imgArray.length-1;} num = num % imgArray.length; slideshow(num); }
[ HTML ]
<html> <head> <title> new document </title>
<script type="text/javascript" src="simpleImageGallery.js"></script> </head>
<body>
<div style="text-align: center"> <!-- Place the first image here --> <img src="image/01.jpg" id="mypic" name="mypic" alt="information" border="0" height="150" width="200"> <br> <!-- Place the text for the first image here --> <div id="burns">The beautiful mountains</div> <p> <a href="#" onclick="slideshowBack(); return false;"> Previous</a> | <a href="#" onclick="slideshowUp(); return false;"> Next </a> </div>
</body> </html>
|