I got this Javascript code to insert random images on page reload. So far, it works, but want to get into details.
- How do I center the images?
How to I insert a different link to a webpage to each images?
function random_imglink(){ var myimages = new Array() //specify random images below. You can have as many as you wish myimages[1] = "http://example.com/picture.jpg" myimages[2] = "http://example.com/image.jpg" myimages[3] = "http://example.com/graphic.jpg" var ry = Math.floor(Math.random() * myimages.length) if (ry == 0) ry = 1 document.write('<img src="' + myimages[ry] + '" border=0>') } random_imglink()