View Full Version : Slideshow Script

04-27-2008, 07:41 PM
Here is my slide show script, although if the 'next' and 'previous' buttons aren't being pressed I want the image and the text to rotate to the next image or caption every 3 seconds, anyone able to modify my code to do this?

var SlideShowSpeed = 3000;
var CrossFadeDuration = 2;

var Picture = new Array();
var Caption = new Array();
var showHot = false;

Picture[1] = 'images/slideshow1.jpg';
Picture[2] = 'images/slideshow2.jpg';
Picture[3] = 'images/slideshow3.jpg';

Caption[1] = "Here you will enter your description for Portfolio Photo #1!";
Caption[2] = "Here you will enter your description for Portfolio Photo #2!";
Caption[3] = "Here you will enter your description for Portfolio Photo #3!";

var tss;
var iss;
var jss = 1;
var pss = Picture.length-1;

var preLoad = new Array();
for (iss = 1; iss < pss+1; iss++){
preLoad[iss] = new Image();
preLoad[iss].src = Picture[iss];}

function control(how){
if (showHot){
if (how=="F") jss = jss + 1;
if (how=="B") jss = jss - 1;
if (jss > (pss)) jss=1;
if (jss < 1) jss = pss;
if (document.all){
document.images.PictureBox.src = preLoad[jss].src;
if (document.getElementById) document.getElementById("CaptionBox").innerHTML= Caption[jss];
if (document.all) document.images.PictureBox.filters.blendTrans.Play();

05-07-2008, 12:30 PM
You have something called slideshowspeed. Where is it being used? Did you intend to call "control" with setInterval perhaps, or setting and calling again each time, setTimeout?

Check out the Curry thread in 'post-a-javascript'. The second message shows an easy way to trigger an 'animation' loop.

05-15-2008, 06:42 PM
Slideshow speed controls the speed the various images fade in and out when the 'next' or 'previous' buttons are clicked, will do... cheers!