/    Sign up×
Community /Pin to ProfileBookmark

[RESOLVED] Slideshow Help Please

Problem my sideshow is not working. Maybe a second pair of eyes can help, I have included the code.

Thank you in advance

URL if needed is

[url]http://vwleases.com/java/slide_show.html[/url]

[upl-file uuid=e9f6a14b-63b1-4d20-9c31-7e1c80be4dea size=934B]slideshow.txt[/upl-file]

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@JMRKERSep 06.2009 — Some of the problem is the use of your dual quotes.

Also, you cannot expect a local variable to remain until next time needed.

Try this instead:
<i>
</i>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;head&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
&lt;title&gt;Slide Show&lt;/title&gt;

&lt;script language="JavaScript"&gt;
// From: http://www.webdeveloper.com/forum/showthread.php?t=216228

<i> </i>var imageList= new Array;
<i> </i>imageList[0] = new Image;
<i> </i>imageList[0].src = "http://vwleases.com/java/image1.jpg";
<i> </i>imageList[1] = new Image;
<i> </i>imageList[1].src = "http://vwleases.com/java/image2.jpg";
<i> </i>imageList[2] = new Image;
<i> </i>imageList[2].src = "http://vwleases.com/java/image3.jpg";
<i> </i>imageList[3] = new Image;
<i> </i>imageList[3].src = "http://vwleases.com/java/image4.jpg";
var imageNumber = 0;

<i> </i>function slideShow() {
<i> </i> document.slideShow.src = imageList[imageNumber].src;
<i> </i> imageNumber += 1;
<i> </i> if (imageNumber &gt;= imageList.length) { imageNumber = 0; }
// window.setTimeout(“slideShow(“ + imageNumber + “)”,3000);
window.setTimeout("slideShow()",3000);
}
&lt;/script&gt;

&lt;/head&gt;

&lt;body onload="slideShow()"&gt;
&lt;img src="image1.jpg" width=300 name="slideShow" /&gt;
&lt;/body&gt;
&lt;/html&gt;

Good Luck!

?
×

Success!

Help @Primesale2000 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.20,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...