Alguien podria decirme pq esto no funciona (esta colocado en el header.template que esta incluido en el main)?
Código :
<h1> <script language="JavaScript" src="js.js"><img src=imatge()> </script> </h1>
en el js.js hay el siguiente código:
Código :
imatge[0] = 'url(images/fons1.jpg)' imatge[1] = 'url(images/fons2.jpg)' imatge[2] = 'url(images/fons3.jpg)' imatge[3] = 'url(images/fons4.jpg)' imatge[4] = 'url(images/fons5.jpg)' var j = 0 var p = imatge.length; var preBuffer = new Array() for (i = 0; i < p; i++){ preBuffer[i] = new Image() preBuffer[i].src = imatge[i] } var quinaImatge = Math.round(Math.random()*(p-1)); function imatge(){ document.write(quinaImatge); }
Hace muchos dias que me estoy rompiendo la cabeza y ha provad 500000 maneras diferentes de hacerlo. No hay manera... os agradeceria mucho una ayudita. Grácias,
cris