Click to See Complete Forum and Search --> : Stop button for Slideshow


jeffda
08-01-2003, 01:33 AM
could someone help me with getting this slideshow script to have a stop button instead of just a start button?

<head>
<title></title>
<SCRIPT LANGUAGE="JavaScript">
<!-- Original: CodeLifter.com (support@codelifter.com) -->
<!-- Web Site: http://www.codelifter.com -->

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
// Set slideShowSpeed (milliseconds)
var slideShowSpeed = 7000;
// Duration of crossfade (seconds)
var crossFadeDuration = 5;
// Specify the image files
var Pic = new Array();
// to add more images, just continue
// the pattern, adding to the array below

Pic[0] = 'http://www.wwva.org/slides/149.jpg'
Pic[1] = 'http://www.wwva.org/slides/150.jpg'
Pic[2] = 'http://www.wwva.org/slides/151.jpg'
Pic[3] = 'http://www.wwva.org/slides/152.jpg'
Pic[4] = 'http://www.wwva.org/slides/153.jpg'
Pic[5] = 'http://www.wwva.org/slides/154.jpg'

// do not edit anything below this line
var t;
var j = 0;
var p = Pic.length;
var preLoad = new Array();
for (i = 0; i < p; i++) {
preLoad[i] = new Image();
preLoad[i].src = Pic[i];
}
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);
}
// End -->
</head>
<body>
<table border="5" width="150" bordercolor="#700233" cellpadding="5" align="center"><!--Begin Slide Show-->
<tr>
<td align="center" valign="top">
<font class="text2"><a href="javascript:runSlideShow()">Start Slideshow</a></font><br>
</td>
</tr>
<tr>
<td id="VU" height="170" width="240">
<img src="http://www.wwva.org/slides/wwvatopview.jpg" name='SlideShow' height="170" width="240"><br>
</td>
</tr>
<!--End Slide Show--></table>
</body>

xataku_nakusute
08-01-2003, 01:56 AM
function stop()
{
setTimeout('runSlideShow()', slideShowSpeed);
}


add this after the bit of code for your slideshow and then add a button/link or something and refernece to stop() onclick

hope it works....if not, sorry

jeffda
08-01-2003, 02:10 AM
It didn't work...although it did manage to speed up the amount of time between pics!! Each time I clicked the link, it speed it up alittle faster

xataku_nakusute
08-01-2003, 03:01 AM
sorry, i dont believe thats what your lookin for, hehe

well, sorry i cant help ya, but hey, im only 14 and got alot more years to go before i become a webmasta

good luck :D