Rotate images upon refresh

How can I design my web page to rotate a new picture into the page upon refresh?  I would like to "cycle" about 8 pics through.  I would like a new one to show up when you refresh the page.  Do you think you can help me?
shlydenAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

jmcvinneyCommented:
if this doesn't have to be done specifically in front page, have you tried using the adrotator component that ships with IIS?
0
rdivilbissCommented:
There is a banner component that comes with FP, but that does not load a new image upon refresh...it rotates images based on a delay...still, you may wan't to look at that.  If you do not wan't a hyperlink for the image, enter "javascript: void();" as the value of the hyperlink.

Possibly a better way (my choice) would be to load a random image using a little javascript.  Put the following in between the <head> ... </head> tags on the HTML view of your page.  (Assuming ten images, named img1.gif through img10.gif)

<SCRIPT>
<!--

rnd.today=new Date();
rnd.seed=rnd.today.getTime();

function rnd() {
        rnd.seed = (rnd.seed*9301+49297) % 233280;
        return rnd.seed/(233280.0);
};

function rand(number) {
        return Math.ceil(rnd()*number);
};

//-->
</SCRIPT>

Where you wish the image to be displayed add this:

<script><!--
document.write('<IMG SRC="img' + rand(10) + '.gif" WIDTH="400" HEIGHT="40">');
//--></script>

Cheers,
Rod
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
shlydenAuthor Commented:
Get answer.  Very informative.  Thank you very much.  You have saved me much time.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Development Software

From novice to tech pro — start learning today.