For displaying the random image from the available images, we can do this by writing a little code by the help of Javascript .
You have also required to declared the array of images which you are going to show different images in every refresh of the page.Then copy and paste the following code you can find your solution.
[code]
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
var theImages = new Array() // do not change this
theImages[0] = ’01.jpg’
theImages[1] = ’02.jpg’
theImages[2] = ’03.jpg’
theImages[3] = ’04.jpg’
// do not edit anything below this line
var j = 0
var p = theImages.length;
var preBuffer = new Array()
for (i = 0; i < p; i++){
preBuffer[i] = new Image()
preBuffer[i].src = theImages[i]
}
var whichImage = Math.round(Math.random()*(p-1));
function showImage(){
document.write(‘<img src="’+theImages[whichImage]+’" border="0">’);
}
</script>
</HEAD>
<BODY>
<SCRIPT LANGUAGE="JavaScript">
showImage();
</script>
</BODY>
[/code]
Thanks for the code! It’s very helpful :*
Thank you
how would i do this if I need 6 images in a row that will all change after refresh… Please help
Thank you
Thank you Hridaya..your script worked perfectly 🙂