Ver Mensaje Individual
  #4 (permalink)  
Antiguo 10/04/2010, 14:34
samu22
 
Fecha de Ingreso: abril-2008
Mensajes: 453
Antigüedad: 17 años
Puntos: 16
Respuesta: PHP y Javascript

tal como lo dice lucasphp, ahora si las imagenes las tenes cargadas dentro de la pagina podes usar esto tambien que no requiere que conoscas el nombre de la imagen

Código HTML:
Ver original
  1.     <head>
  2.         <script type="text/javascript">
  3.             function ini(){
  4.                 var cont = document.getElementById('ImagenesCont');
  5.                 var imgs = cont.getElementsByTagName('img');
  6.                 var num = Math.floor(Math.random() * imgs.length);
  7.                 document.getElementById('im').src = imgs[num].src;
  8.             }
  9.         </script>
  10.     </head>
  11.     <body onload="ini()">
  12.         <div id="ImagenesCont" style="display:none">
  13.             <img src="http://profile.ak.fbcdn.net/v22943/184/121/t1554270736_2888.jpg" />
  14.             <img src="http://www.webintenta.com/Files/Breves/1004201016.jpg" />
  15.             <img src="http://www.webintenta.com/Files/Breves/1004201015.jpg" />
  16.             <img src="http://www.webintenta.com/Files/Breves/100420103.jpg" />
  17.             <img src="http://www.webintenta.com/Files/Breves/100420102.jpg" />
  18.             <img src="http://www.webintenta.com/Files/Breves/100420101.jpg" />
  19.         </div>
  20.         <img id="im" src="" />
  21.        
  22.        
  23.     </body>
  24. </html>