Is there a way to preload images for a slide show that has about 20 images-- I want the images to stay up for 3 seconds --works great on fast connections but on the slower connections that is not enough time for the next picture to load, so the slide show becomes disfunctional.
HERE'S EXAMPLE OF SCRIPT
<SCRIPT LANGUAGE="JavaScript">
var rotate_delay = 3000; // delay in milliseconds (3000 = 3 secs)
current = 0;
function next() {
if (document.slideform.slide[current+1]) {
document.images.show.src = document.slideform.slide[current+1].value;
document.slideform.slide.selectedIndex = ++current;
}
else first();
}
function previous() {
if (current-1 >= 0) {
document.images.show.src = document.slideform.slide[current-1].value;
document.slideform.slide.selectedIndex = --current;
}
else last();
}
function first() {
current = 0;
document.images.show.src = document.slideform.slide[0].value;
document.slideform.slide.selectedIndex = 0;
}
function last() {
current = document.slideform.slide.length-1;
document.images.show.src = document.slideform.slide[current].value;
document.slideform.slide.selectedIndex = current;
}
function ap(text) {
document.slideform.slidebutton.value = (text == "Stop" ? "Start" : "Stop";
rotate();
}
function change() {
current = document.slideform.slide.selectedIndex;
document.images.show.src = document.slideform.slide[current].value;
}
function rotate() {
if (document.slideform.slidebutton.value == "Stop" {
current = (current == document.slideform.slide.length-1) ? 0 : current+1;
document.images.show.src = document.slideform.slide[current].value;
document.slideform.slide.selectedIndex = current;
window.setTimeout("rotate()", rotate_delay);
}
}
</script>
<form name=slideform>
<table width="71%" border="0">
<tr>
<td width="19%"><img src="images/menu.gif" width="200" height="162" alt="Directions" usemap="#Map" border="0">
<map name="Map13">
<area shape="rect" coords="2,81,184,104" href="index.html" alt="back to index page" title="back to index page">
<area shape="rect" coords="3,108,167,124" href="../index.html" alt="back to home page" title="back to home page">
<area shape="rect" coords="46,2,196,11" </map>
</td>
<td width="81%">
<table cellspacing=0 cellpadding=0 align="right" border="10" width="212">
<tr>
<td align=center bgcolor="#CCCCCC" width="190"> <b></b></td>
</tr>
<tr>
<td align=center bgcolor="white" width=190 height=300> <img src="images/ped/frontduo.jpg" name="show">
</td>
</tr>
<tr>
<td align=center bgcolor="#C0C0C0" width="190">
<select name="slide" onChange="change();">
<option lue="tourimages/ped/p1.jpg">Slide1
<option value="images/ped/p2.jpg">Slide2
<option value="images/ped/p3.jpg">Slide3
<option value="tourimages/ped/l1.jpg">Slide4
<option value="images/ped/l3.jpg">Slide 5
<option value="timages/ped/l4.jpg">Slide6
<option value="images/ped/l5.jpg">Slide7
<option value="tourimages/ped/s1.jpg">Slide8
<option value="images/ped/s2.jpg">Slide9
<option value="images/ped/s3.jpg">Slide10
<option value="images/ped/s4.jpg">Slide11
<option value="images/ped/s5.jpg">Slide12
<option value="images/ped/b1.jpg">Slide 13
<option value="images/ped/b2.jpg">Slide14
<option value="images/ped/b3.jpg">Slide15
<option value="images/ped/w1.jpg">Slide16
<option value="images/ped/w2.jpg">Slide17
<option value="images/ped/w4.jpg">Slide18
<option value="images/ped/w5.jpg">Slide19
</select>
</td>
</tr>
<tr>
<td align=center bgcolor="#336699" width="190" height="19">
<input type=button onClick="previous();" value="<<" title="Previous" name="button">
<input type=button name="slidebutton" onClick="ap(this.value);" value="Start" title="AutoPlay">
<input type=button onClick="next();" value=">>" title="Next" name="button">
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>
Thanks
bch
HERE'S EXAMPLE OF SCRIPT
<SCRIPT LANGUAGE="JavaScript">
var rotate_delay = 3000; // delay in milliseconds (3000 = 3 secs)
current = 0;
function next() {
if (document.slideform.slide[current+1]) {
document.images.show.src = document.slideform.slide[current+1].value;
document.slideform.slide.selectedIndex = ++current;
}
else first();
}
function previous() {
if (current-1 >= 0) {
document.images.show.src = document.slideform.slide[current-1].value;
document.slideform.slide.selectedIndex = --current;
}
else last();
}
function first() {
current = 0;
document.images.show.src = document.slideform.slide[0].value;
document.slideform.slide.selectedIndex = 0;
}
function last() {
current = document.slideform.slide.length-1;
document.images.show.src = document.slideform.slide[current].value;
document.slideform.slide.selectedIndex = current;
}
function ap(text) {
document.slideform.slidebutton.value = (text == "Stop" ? "Start" : "Stop";
rotate();
}
function change() {
current = document.slideform.slide.selectedIndex;
document.images.show.src = document.slideform.slide[current].value;
}
function rotate() {
if (document.slideform.slidebutton.value == "Stop" {
current = (current == document.slideform.slide.length-1) ? 0 : current+1;
document.images.show.src = document.slideform.slide[current].value;
document.slideform.slide.selectedIndex = current;
window.setTimeout("rotate()", rotate_delay);
}
}
</script>
<form name=slideform>
<table width="71%" border="0">
<tr>
<td width="19%"><img src="images/menu.gif" width="200" height="162" alt="Directions" usemap="#Map" border="0">
<map name="Map13">
<area shape="rect" coords="2,81,184,104" href="index.html" alt="back to index page" title="back to index page">
<area shape="rect" coords="3,108,167,124" href="../index.html" alt="back to home page" title="back to home page">
<area shape="rect" coords="46,2,196,11" </map>
</td>
<td width="81%">
<table cellspacing=0 cellpadding=0 align="right" border="10" width="212">
<tr>
<td align=center bgcolor="#CCCCCC" width="190"> <b></b></td>
</tr>
<tr>
<td align=center bgcolor="white" width=190 height=300> <img src="images/ped/frontduo.jpg" name="show">
</td>
</tr>
<tr>
<td align=center bgcolor="#C0C0C0" width="190">
<select name="slide" onChange="change();">
<option lue="tourimages/ped/p1.jpg">Slide1
<option value="images/ped/p2.jpg">Slide2
<option value="images/ped/p3.jpg">Slide3
<option value="tourimages/ped/l1.jpg">Slide4
<option value="images/ped/l3.jpg">Slide 5
<option value="timages/ped/l4.jpg">Slide6
<option value="images/ped/l5.jpg">Slide7
<option value="tourimages/ped/s1.jpg">Slide8
<option value="images/ped/s2.jpg">Slide9
<option value="images/ped/s3.jpg">Slide10
<option value="images/ped/s4.jpg">Slide11
<option value="images/ped/s5.jpg">Slide12
<option value="images/ped/b1.jpg">Slide 13
<option value="images/ped/b2.jpg">Slide14
<option value="images/ped/b3.jpg">Slide15
<option value="images/ped/w1.jpg">Slide16
<option value="images/ped/w2.jpg">Slide17
<option value="images/ped/w4.jpg">Slide18
<option value="images/ped/w5.jpg">Slide19
</select>
</td>
</tr>
<tr>
<td align=center bgcolor="#336699" width="190" height="19">
<input type=button onClick="previous();" value="<<" title="Previous" name="button">
<input type=button name="slidebutton" onClick="ap(this.value);" value="Start" title="AutoPlay">
<input type=button onClick="next();" value=">>" title="Next" name="button">
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>
Thanks
bch