/    Sign up×
Community /Pin to ProfileBookmark

How to Get Images to Change

I’m attempting to make a mainly HTML based page and would like to know how to make it so the banners at the top of my screen switch between images every few seconds.

I would like to know if this is possible with geocities.yahoo.com/ based webpages, and if so, what is the correct code. I’ve tried numerous things and have not been able to get it to work yet.

Thank You.

to post a comment
JavaScript

5 Comments(s)

Copy linkTweet thisAlerts:
@JPnycOct 26.2004 — What have you tried? There are plenty of free scripts for such things on the web. Try googling javascript slideshow. You should find at least a few.
Copy linkTweet thisAlerts:
@ScriptNoobie86Oct 26.2004 — var picture = new Array(number of picture);

picture[0]="src";

picture[1]="src";

picture[2]="src";

picture[3]="src";

ect...

var i=0

<script>

function slides()

{

document.all.imageid.src=[i++] //replace imageid with your image's id

if(i>3)// array length

i=0

setTimeout("slides()",5000) //return to function after 5000 miliseconds

}

</script>

<body onload="slides()"> //call function onload
Copy linkTweet thisAlerts:
@JPnycOct 27.2004 — That will only work in IE. He can find a script by googling that will work in more than just 1 browser.
Copy linkTweet thisAlerts:
@ScriptNoobie86Oct 27.2004 — I dont have more than IE, what sort of codes only work in ie and not ns? like what from my last func doesnt work for ns jw
Copy linkTweet thisAlerts:
@JPnycOct 27.2004 — document.all.imageid - that is the IE only part. Some (older?) versions of Opera may understand it as well, but I can't remember which ones. NS and mozilla will not, nor will Safari.
×

Success!

Help @TsumeFaC 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.6,
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: @Yussuf4331,
tipped: article
amount: 1000 SATS,

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

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...