Hi im having a dumbass problem its probably something stupid as it always is with me. Basically ive incorporated a javascript random image background. It works however it occasionally displays a WHITE bg, as if its trying to link to one of the images in the array and its not there. To get what i mean view the link below and click REFRESH until it goes white.
http://www.focuswebs.co.uk/clients/hollie
Im new to web design and all this lark but have a basic in all areas. I know that arrays usually start from 0 or something but i think theres osmething in this code to change that. If any one can help, it would be much appreciated!
This is the code at the top of the page:
This code is found at the bottom of the page:
thanks in advance
regards ian
http://www.focuswebs.co.uk/clients/hollie
Im new to web design and all this lark but have a basic in all areas. I know that arrays usually start from 0 or something but i think theres osmething in this code to change that. If any one can help, it would be much appreciated!
This is the code at the top of the page:
Code:
<script language="JavaScript" type="text/JavaScript"> <!-- <!-- Activate cloaking device var randnum = Math.random(); var inum = 14; var rand1 = Math.round(randnum * (inum-1)) + 1; images = new Array images[1] = "images/bg1.gif" images[2] = "images/bg2.gif" images[3] = "images/bg3.gif" images[4] = "images/bg4.gif" images[5] = "images/bg5.gif" images[6] = "images/bg7.jpg" images[7] = "images/bg7.gif" images[8] = "images/bg8.gif" images[9] = "images/bg9.gif" images[10] = "images/bg10.jpg" images[11] = "images/bg11.gif" images[12] = "images/bg12.gif" images[13] = "images/bg13.gif" images[14] = "images/bg14.gif" var image = images[rand1] // Deactivate cloaking device --> </script>
Code:
<script language="JavaScript" type="text/javascript"> <!-- Activate cloaking device document.write('<body background="' + image + '" text="blue" link="blue" alink="blue" vlink="blue">') // Deactivate cloaking device --> </script>
regards ian
Comment