Kevin
02-01-2003, 05:27 AM
Put together a slide show with an auto and manual setup.
Everything looks o.k. but I have several object not supported errors. Can you advise?
insight always appreciated
Thank You;)
Kevin
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0062)http://voyager.deanza.fhda.edu/~philun/JSExamples/images1.html -->
<HTML><HEAD><TITLE>Phlowers</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<SCRIPT language=JavaScript type=text/javascript>
<!--
var MyPics = new Array()
if (document.images) {
MyPics[0] = new Image(288,288) // pre-cache slide images
MyPics[1] = new Image(288,288)
MyPics[2] = new Image(288,288)
MyPics[3] = new Image(288,288)
MyPics[4] = new Image(288,288)
MyPics[5] = new Image(288,288)
MyPics[0].src = "flower01.gif"
MyPics[1].src = "flower02.gif"
MyPics[2].src = "flower03.gif"
MyPics[3].src = "flower04.gif"
MyPics[4].src = "flower05.gif"
MyPics[5].src = "flower06.gif"
}
var IndexSlide = 0;
var LastSlide = MyPics.length - 1;
var Manual = 1;
var AutoTimer = 0;
function RandSlide()
{
var NxtSlide = Math.floor(Math.Random() * 6 );
document.Pix.src = MyPics[NxtSlide].src;
} /* end RandSlide() */
function Auto()
{
if (AutoTimer)
{
clearTimeout(AutoTimer);
}
AutoTimer = setTimeout (RandSlide(), 1500);
} /* end Auto() */
function Manual()
{
Manual = 1;
if (AutoTimer)
{
clearTimeout (AutoTimer);
} /* if */
} /* end Manual() */
function NextPix()
{
if (manual)
{
IndexSlide++
if (IndexSlide > LastSlide) {
IndexSlide = 0
}
}
document.Pix.src = MyPics[IndexSlide].src
} /* end NextPix() */
function PrevPix ()
{
if (Manual)
{
IndexSlide--
if (IndexSlide < 0) {
IndexSlide = lastSlide
} /* if */
document.Pix.src = MyPics[IndexSlide].src
}
else
{
alert ("Rand Slide show in progress please hit the manual button to end the show.");
} /* if */
} /* end PrevPix() */
//-->
</SCRIPT>
<META content="MSHTML 6.00.2800.1126" name=GENERATOR></HEAD>
<BODY bgColor=cornsilk>
<DIV align=center>
<P><BR></P>
<H2>Phil's Phlower Photos</H2>
<P><BR></P><IMG height=288 alt=FLOWERS src="flower01.gif" width=288 name=Pix>
<FORM name=SlideShow>
<INPUT onclick=PreviousPix() type=button value=" << ">
<img src="spacer.gif" width="50" height="5" alt="" border="0">
<INPUT onclick=NextPix() type=button value=" >> "><br />
Please choose either the manual button or the auto button for browsing thru the slides.<br />
<input type="button" name="Manual" value=" manual " onClick="Manual()">
<img src="spacer.gif" width="50" height="5" alt="" border="0">
<INPUT type=button onClick="Auto()" value=" auto ">
</FORM>
</DIV>
</BODY>
</HTML>
Everything looks o.k. but I have several object not supported errors. Can you advise?
insight always appreciated
Thank You;)
Kevin
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0062)http://voyager.deanza.fhda.edu/~philun/JSExamples/images1.html -->
<HTML><HEAD><TITLE>Phlowers</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<SCRIPT language=JavaScript type=text/javascript>
<!--
var MyPics = new Array()
if (document.images) {
MyPics[0] = new Image(288,288) // pre-cache slide images
MyPics[1] = new Image(288,288)
MyPics[2] = new Image(288,288)
MyPics[3] = new Image(288,288)
MyPics[4] = new Image(288,288)
MyPics[5] = new Image(288,288)
MyPics[0].src = "flower01.gif"
MyPics[1].src = "flower02.gif"
MyPics[2].src = "flower03.gif"
MyPics[3].src = "flower04.gif"
MyPics[4].src = "flower05.gif"
MyPics[5].src = "flower06.gif"
}
var IndexSlide = 0;
var LastSlide = MyPics.length - 1;
var Manual = 1;
var AutoTimer = 0;
function RandSlide()
{
var NxtSlide = Math.floor(Math.Random() * 6 );
document.Pix.src = MyPics[NxtSlide].src;
} /* end RandSlide() */
function Auto()
{
if (AutoTimer)
{
clearTimeout(AutoTimer);
}
AutoTimer = setTimeout (RandSlide(), 1500);
} /* end Auto() */
function Manual()
{
Manual = 1;
if (AutoTimer)
{
clearTimeout (AutoTimer);
} /* if */
} /* end Manual() */
function NextPix()
{
if (manual)
{
IndexSlide++
if (IndexSlide > LastSlide) {
IndexSlide = 0
}
}
document.Pix.src = MyPics[IndexSlide].src
} /* end NextPix() */
function PrevPix ()
{
if (Manual)
{
IndexSlide--
if (IndexSlide < 0) {
IndexSlide = lastSlide
} /* if */
document.Pix.src = MyPics[IndexSlide].src
}
else
{
alert ("Rand Slide show in progress please hit the manual button to end the show.");
} /* if */
} /* end PrevPix() */
//-->
</SCRIPT>
<META content="MSHTML 6.00.2800.1126" name=GENERATOR></HEAD>
<BODY bgColor=cornsilk>
<DIV align=center>
<P><BR></P>
<H2>Phil's Phlower Photos</H2>
<P><BR></P><IMG height=288 alt=FLOWERS src="flower01.gif" width=288 name=Pix>
<FORM name=SlideShow>
<INPUT onclick=PreviousPix() type=button value=" << ">
<img src="spacer.gif" width="50" height="5" alt="" border="0">
<INPUT onclick=NextPix() type=button value=" >> "><br />
Please choose either the manual button or the auto button for browsing thru the slides.<br />
<input type="button" name="Manual" value=" manual " onClick="Manual()">
<img src="spacer.gif" width="50" height="5" alt="" border="0">
<INPUT type=button onClick="Auto()" value=" auto ">
</FORM>
</DIV>
</BODY>
</HTML>