Hi all,
I found a script that displays random images whenever a user visits my site. Here is what I have:
Code:
<script language="JavaScript">
<!--
function random_imglink(){
var myimages=new Array()
//specify random images below. You can have as many as you wish
myimages[1]="image1.gif"
myimages[2]="image2.gif"
myimages[3]="image3.gif"
myimages[4]="image4.gif"
myimages[5]="image5.gif"
myimages[6]="image6.gif"
var ry=Math.floor(Math.random()*myimages.length)
if (ry==0)
ry=1
document.write('<img src="'+myimages[ry]+'" align=center border=1>')
}
random_imglink()
//-->
</script>
The problem with this is the:
document.write('<img src="'+myimages[ry]+'"
align=center border=1>')
portion of the script. For some reason, it doesn't center. I know I am making a really easy mistake but for some reason, I don't know what it is. If I replace aligh=center with aligh=right, it seems to work.
Any help will be appreciated.
Thanks in advance.