Reno CF
05-15-2003, 04:21 PM
I recently found a nice script that loads images sequentially into a space, like a slideshow but without the advance button. However it does not have a variable that I can set for the amount of time between image loads, and I'm wondering if that can be added? If there is a line of js that I can include to accomplish that, I think it would help:
Here is the script in question:
<script type="text/javascript">
<!--
// Set to appropriate image name.
var image="";
// Set to appropriate URL
var destination="";
// Sequential Image/Link determining function.
function sequentialLoad()
{
// Keep seq_number within correct range
if (parent.seq_number>7)
parent.seq_number=1;
// Set variable image equal to appropriate image file name & URL.
if (parent.seq_number==1)
{
destination="foo_1.html";
image="image1.gif";
}
if (parent.seq_number==2)
{
destination="foo_2.html";
image="image2.gif";
}
if (parent.seq_number==3)
{
destination="foo_3.html";
image="image3.gif";
}
if (parent.seq_number==4)
{
destination="foo_4.htm";
image="image4.gif";
}
if (parent.seq_number==5)
{
destination="foo_5.htm";
image="image5.gif";
}
if (parent.seq_number==6)
{
destination="foo_6.htm";
image="image6.gif";
}
if (parent.seq_number==7)
{
destination="foo_7.htm";
image="image7.gif";
}
parent.seq_number++;
}
// -->
</SCRIPT>
</head>
<BODY>
<script type="text/javascript">
<!--
sequentialLoad()
// Open document for writing.
document.open();
document.write("<CENTER><A HREF='"+destination+"' TARGET='frame3'><IMG SRC="+image+" WIDTH=50 HEIGHT=50 BORDER=0></A></CENTER>");
// -->
</SCRIPT>
Here is the script in question:
<script type="text/javascript">
<!--
// Set to appropriate image name.
var image="";
// Set to appropriate URL
var destination="";
// Sequential Image/Link determining function.
function sequentialLoad()
{
// Keep seq_number within correct range
if (parent.seq_number>7)
parent.seq_number=1;
// Set variable image equal to appropriate image file name & URL.
if (parent.seq_number==1)
{
destination="foo_1.html";
image="image1.gif";
}
if (parent.seq_number==2)
{
destination="foo_2.html";
image="image2.gif";
}
if (parent.seq_number==3)
{
destination="foo_3.html";
image="image3.gif";
}
if (parent.seq_number==4)
{
destination="foo_4.htm";
image="image4.gif";
}
if (parent.seq_number==5)
{
destination="foo_5.htm";
image="image5.gif";
}
if (parent.seq_number==6)
{
destination="foo_6.htm";
image="image6.gif";
}
if (parent.seq_number==7)
{
destination="foo_7.htm";
image="image7.gif";
}
parent.seq_number++;
}
// -->
</SCRIPT>
</head>
<BODY>
<script type="text/javascript">
<!--
sequentialLoad()
// Open document for writing.
document.open();
document.write("<CENTER><A HREF='"+destination+"' TARGET='frame3'><IMG SRC="+image+" WIDTH=50 HEIGHT=50 BORDER=0></A></CENTER>");
// -->
</SCRIPT>