|
Just the basics, but hey, someone could find it helpful. <script> // Slide Show by CD of Studio Zero (http://studiozero.proboards44.com/)
// This is the number of seconds before the image's switch. var timeSet = 3;
/* Add a new line and raise the number by one for each new image.*/var imaShow = new Array(); imaShow[0] = "First Image URL"; imaShow[1] = "Second Image URL";
document.write("<center><img src='"+imaShow[0]+"' border='0' id='currentImage' alt='Image 0' /><br /><a href='javascript:void(0);' onclick='prevImg();'>Previous</a> | <a href='javascript:void(0);' onclick='pauseImg();'>Pause</a> | <a href='javascript:void(0);' onclick='nextImg();'>Next</a></center>");
var realTime = parseInt(timeSet*1000);
intCreate = setInterval("nextImg()",realTime); var ImgFor = document.getElementById("currentImage"); var running = true;
function nextImg(){ if(running){ clearInterval(intCreate); } var curPlace = parseInt(ImgFor.alt.split("Image ")[1]); curPlace++;
if(curPlace >= imaShow.length){ curPlace = 0; }
ImgFor.src = imaShow[curPlace]; ImgFor.alt = "Image "+curPlace; if(running){ intCreate = setInterval("nextImg()",realTime); } }
function prevImg(){ if(running){ clearInterval(intCreate); } var curPlace = parseInt(ImgFor.alt.split("Image ")[1]); curPlace--;
if(curPlace < 0){ curPlace = imaShow.length-1; }
ImgFor.src = imaShow[curPlace]; ImgFor.alt = "Image "+curPlace; if(running){ intCreate = setInterval("nextImg()",realTime); } }
function pauseImg(){ if(running){ clearInterval(intCreate); running = false; } else { intCreate = setInterval("nextImg()",realTime); running = true; } }
</script>
|
|
|
|
|
Nice Could be useful for image slides for projects of something...
|
|
|
|
Nice code,I will proably find this useful on my site.
|
This signature area for rent. Inquire within.
|
|
|