Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

javascript slideshow tweaking

Status
Not open for further replies.

grebo

Programmer
Sep 21, 1998
38
US
OK, I've got the code below to run a continuous loop slideshow, however, even though it runs I get an error in the status bar of Netscape 4.5 (haven't tested anything else yet). How do I get rid of the error? Also, how can I get the last picture, gp9.gif, to stay a little longer (like a general 5 times longer?) before the loop starts over? <br>
<br>
Interestingly enough, I've got the same script running only four graphics on an Intranet site, and there's no problems with it.<br>
<br>
So, Here's the code for the page:<br>
&lt;html&gt;<br>
<br>
&lt;head&gt;<br>
&lt;title&gt;Grebo Productions - Web Development, Consulting, and Production&lt;/title&gt;<br>
&lt;meta name="GENERATOR" content="Microsoft FrontPage 3.0"&gt;<br>
&lt;script language="JavaScript"&gt;<br>
&lt;!-- Hiding the code from non-java enabled browsers<br>
if(navigator.appVersion.substring(0,1) &gt;=3) {<br>
grebo1 = new Image ();<br>
grebo1.src = "images/gp1.gif"; <br>
grebo2 = new Image ();<br>
grebo2.src = "images/gp2.gif";<br>
grebo3 = new Image ();<br>
grebo3.src = "images/gp3.gif";<br>
grebo4 = new Image ();<br>
grebo4.src = "images/gp4.gif";<br>
grebo5 = new Image ();<br>
grebo5.src = "images/gp5.gif";<br>
grebo6 = new Image ();<br>
grebo6.src = "images/gp6.gif";<br>
grebo7 = new Image ();<br>
grebo7.src = "images/gp7.gif";<br>
grebo8 = new Image ();<br>
grebo8.src = "images/gp8.gif";<br>
grebo9 = new Image ();<br>
grebo9.src = "images/gp9.gif";<br>
<br>
}<br>
<br>
slides = 9<br>
rotations = 100<br>
speed = 500 //in milliseconds<br>
<br>
function runit() {<br>
for (x=1, y=0 ; x &lt; (slides*rotations); x=x+slides, y=0) {<br>
setTimeout("document.slideshow.src = grebo1.src",((x + y) * speed))<br>
y++; setTimeout("document.slideshow.src = grebo2.src",((x + y) * speed))<br>
y++; setTimeout("document.slideshow.src = grebo3.src",((x + y) * speed))<br>
y++; setTimeout("document.slideshow.src = grebo4.src",((x + y) * speed))<br>
y++; setTimeout("document.slideshow.src = grebo5.src",((x + y) * speed))<br>
y++; setTimeout("document.slideshow.src = grebo6.src",((x + y) * speed))<br>
y++; setTimeout("document.slideshow.src = grebo7.src",((x + y) * speed))<br>
y++; setTimeout("document.slideshow.src = grebo8.src",((x + y) * speed))<br>
y++; setTimeout("document.slideshow.src = grebo9.src",((x + y) * speed))<br>
<br>
}<br>
}<br>
// End of hiding --&gt;<br>
&lt;/script&gt;<br>
&lt;/head&gt;<br>
<br>
&lt;body onload="runit()"&gt;<br>
<br>
&lt;p align="center"&gt;&lt;a href="next.htm"&gt;&lt;img src="images/gp1.gif" name="slideshow"<br>
width="552" height="457" border="0"&gt;&lt;/a&gt;&lt;/p&gt;<br>
&lt;/body&gt;<br>
&lt;/html&gt;<br>
<br>
<br>
I should have it posted this evening at
 
Wish I could help you, but the thing seems to work just fine in IE5.0 :?:<br>
<br>
P.S. Nice script!
 
OK, sorry for the delay. I've got the script running at if anyone wants to check it out. <br>
<br>
The original error I had was due to another netscape window open with a JavaScript function with the same name running. No biggie.<br>
<br>
Any suggestions for extending the last frame by a factor of five?<br>
<br>
Thanks<br>
-Eric
 
Oooh! LOTS of "setTimaout"s!!!; I think I can halp you with this, but It may be a couple of days before I get a chance to really work on it....hopefully I'll be able to perfect it for you by this time next week.<br>
<br>
Sorry about the timing :(<br>
<br>
<br>
-Robherc
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top