# Simple Java Slideshow



## ChelleWSU (Sep 7, 2004)

I'm new to JavaScript. I'm trying to get a java slideshow that is somewhat controlled by the user. I want the user to be able to Start the slideshow, Pause it, go Forward and go Back. That's it. Nothing fancy. Maybe a fade feature would be nice, but I'd just like to get the logistics to work first. Can anyone help me out? Here's what I have so far:

<script>
var slideShowSpeed = 3000
var crossFadeDuration = 2
var Pic = new Array() 

Pic[0] = '1.jpg';
Pic[1] = '2.jpg';
Pic[2] = '3.jpg';
Pic[3] = '4.jpg';
Pic[4] = '5.jpg';

var t
var j = 0
var p = Pic.length

var preLoad = new Array()
for (i = 0; i < p; i++){
preLoad_ = new Image()
preLoad.src = Pic
}

function runSlideShow(){
if (document.all){
document.images.SlideShow.style.filter="blendTrans(duration=2)"
document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)"
document.images.SlideShow.filters.blendTrans.Apply() 
}
document.images.SlideShow.src = preLoad[j].src
if (document.all){
document.images.SlideShow.filters.blendTrans.Play()
}
j = j + 1
if (j > (p-1)) j=0
t = setTimeout('runSlideShow()', slideShowSpeed)
}
</script>

<body onload="runSlideShow()"> 

<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td id="VU" height=150 width=150>
<img src="1.jpg" name='SlideShow' width=150 height=150></td>
</tr>
</table>

As you can see, there are no controls and it starts automatically. I'd like to change that. Does anyone know where I should start? A frame of reference? Any help would be appreciated._


----------



## 95five-0 (Dec 7, 2004)

Check this site out

http://www.hscripts.com/scripts/JavaScript/slide-show-software.php

They have a copy and paste Java slide show.


----------

