Forum Moderators: open
apparently the search function of the site is no longer available, so, while this has probably been asked and answered half a dozen times...
Can you let me know the best method of swapping a main image on the index page? My intent is simply to have one of three or four images be called when a user visits the page. If he/she refreshes the page, a new picture is there. There's no mouseover issues, just a new picture each time someone visits.
Many thanks if you can point me in the right direction.
Best Regards,
Pat
If you have a chance to do it in server script do it like:
<img src="default_image_name<%get_random(5)%>.jpg">
where get_random_image is a server side function getting a random number from 0-5 attaching it to a default_image_nameX.jpg, where images reside on the server.
Other solution is pure javascript solution
document.write("<img src='default_image_name" + get_random(5) + "'>")
where the function is writen in javascript, it is also ran on the client side, so you do not need a server to interpret the code and it could be native html page.
Helpful?
Uwebe