Help me find a javascript for selecting an image at random, and then some corresponding text lower down on the page.
I am making a webpage with several different versions of the main header graphic, each by a different artist. Every time the page loads, I want one of these images to load at random. Well beyond the header, down near the bottom of the sidebar, I want to credit the artist in question - ie, put some text and a link, corresponding to whichever image was loaded.
Put another way, I want something that generates the following code:
[then, much later on the page:]
header graphic by image1_artist.
Can anyone point me to - or devise - a javascript that will allow me to do this? I've looked at
this AskMeFi question, and am currently using
A List Apart's Better Rotator, but that doesn't allow me to do the other half of what I want.
Thanks so much!
Let's try again - this is the kind of code I'm looking to use:
<img src="image1.jpg" alt="Image by image1_artist">
[then, much later on the page:]
header graphic by <a href="http://image1_artist_website">image1_artist</a>.
posted by Marquis at 7:55 AM on February 25, 2007