/    Sign up×
Community /Pin to ProfileBookmark

No Idea if this belongs here(Changing Pics On reload)

I want to have a set of pics that change everytime the page is reloaded. I have seen this on a few pages, but I can not find the code for what I want.

If you want a example of what I want go to [URL=http://www.scgs.qld.edu.au]SCGS[/URL].

The pics on the side change for 5 reloads.

If anyone knows how they do this, or any way to reach the same effect, please reply.

Thanks

Wofen

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@HaganeNoKokoroJun 02.2005 — They appear to be using PHP to create this effect. PHP dynamically builds the html for a page on the server before sending it to the client, so the picture is different every time. Identical results will be possible with any server-side language, such as ASP(.NET), Perl, or JSP/Java.

That is the best way to do it. It is also possible to do this on the client machine using javascript. The downside of this approach is it will not work for users who, by choice or necessity, browse without javascript. However, if you do not have server-side languages available, this will be the best you can do.
Copy linkTweet thisAlerts:
@BluetagpizzaJun 02.2005 — What you are talking about is commonly called a rotating banner script. Here's javascript version which I found using Google: http://www.javascriptcity.com/scripts/local/simage2.htm

If that's not quite what you're looking for do a Google search as there are quite literally thousands out there.
×

Success!

Help @Wofen 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,
)...