web.blazonry : web development stuff Home : JavaScript : Image Slideshow
about web.blazonry



JavaScript : Slide Show

A Pictorial History of mkaz.com

Previous


Next

 

The slide show uses the same principial as the Mouse Over script.  It just adds more images into it, and works when the buttons are clicked not moused over.

JavaScript Source Code:

<script LANGUAGE="JavaScript">
<!--

var imgArray = new Array("start.gif", ...);
var descArray = new Array("Intro Page", ...);
var imgDir = "";
var pos = 0;
// initial images (pre-load)
if (document.images) {
for (i=0; i<imgArray.length; i++) {
eval("imgObj" + i + "= new Image()");
eval("imgObj" + i + ".src = '" + imgDir + imgArray[i] + "'");
}
}


function toPrevious() {

if (pos == 0) { pos = imgArray.length - 1; }
else { pos = pos - 1 };

eval("document.vvr.src = imgObj"+pos+".src");
document.theForm.desc.value = descArray[pos];
}

function toNext() {

if (pos == imgArray.length - 1) { pos = 0; }
else { pos = pos + 1; }

eval("document.vvr.src = imgObj"+pos+".src");
    document.theForm.desc.value = descArray[pos];
}


//-->
</script>

 


  © 1997-2003. astonishinc.com   All Rights Reserved.