Hello,
I took over a project that some one else developed and Im having trouble with the random image banner..This script is in the head
[QUOTE]
<script language=”JavaScript”>
Image_1_Array=new Array(
“/photos/head_photos/1.jpg”,
“/photos/head_photos/2.jpg”,
“/photos/head_photos/3.jpg”,
“/photos/head_photos/4.jpg”,
“/photos/head_photos/5.jpg”,
“/photos/head_photos/6.jpg”);
random_image_1=Math.floor(Image_1_Array.length*Math.random());
random_image_1='<IMG SRC=”‘+ Image_1_Array[random_image_1]+ ‘” alt=”” height=”200″ width=”200″ border=”0″>’;
Image_2_Array=new Array(
“/photos/head_photos/7.jpg”,
“/photos/head_photos/8.jpg”,
“/photos/head_photos/9.jpg”,
“/photos/head_photos/10.jpg”,
“/photos/head_photos/11.jpg”,
“/photos/head_photos/12.jpg”);
random_image_2=Math.floor(Image_2_Array.length*Math.random());
random_image_2='<IMG SRC=”‘+ Image_2_Array[random_image_2]+ ‘” alt=”” height=”200″ width=”200″ border=”0″>’;
</script>
and this is in the body where I want the images to appear
[QUOTE]
<script>
<!–
document.write(random_image_1);
// –>
</script>
Ok, the problem is I want to add more images into the rotation but when I do the whole thing stops working ?
[QUOTE]
<script language=”JavaScript”>
Image_1_Array=new Array(
“/photos/head_photos/1.jpg”,
“/photos/head_photos/2.jpg”,
“/photos/head_photos/3.jpg”,
“/photos/head_photos/4.jpg”,
“/photos/head_photos/5.jpg”,
“/photos/head_photos/6.jpg”
“/photos/head_photos/7.jpg”,
“/photos/head_photos/8.jpg”,
“/photos/head_photos/9.jpg”);
random_image_1=Math.floor(Image_1_Array.length*Math.random());
random_image_1='<IMG SRC=”‘+ Image_1_Array[random_image_1]+ ‘” alt=”” height=”200″ width=”200″ border=”0″>’;
Image_2_Array=new Array(
“/photos/head_photos/7.jpg”,
“/photos/head_photos/8.jpg”,
“/photos/head_photos/9.jpg”,
“/photos/head_photos/10.jpg”,
“/photos/head_photos/11.jpg”,
“/photos/head_photos/12.jpg”
“/photos/head_photos/13.jpg”,
“/photos/head_photos/14.jpg”,
“/photos/head_photos/15.jpg”
“/photos/head_photos/16.jpg”,
“/photos/head_photos/17.jpg”,
“/photos/head_photos/18.jpg”);
random_image_2=Math.floor(Image_2_Array.length*Math.random());
random_image_2='<IMG SRC=”‘+ Image_2_Array[random_image_2]+ ‘” alt=”” height=”200″ width=”200″ border=”0″>’;
</script>
what am I missing? I should be able to have as many images as I want.