Ver Mensaje Individual
  #2 (permalink)  
Antiguo 06/12/2003, 17:29
Avatar de caricatos
caricatos
Moderador
 
Fecha de Ingreso: abril-2002
Ubicación: Torremolinos (Málaga)
Mensajes: 19.607
Antigüedad: 22 años
Puntos: 1284
Hola duchamp:

Dime si te sirve esto:

Código PHP:
<html>
<
head>
<
title>
    
4 imágenes sin repetir
</title>
<
script>
var 
imagenes = [
    
"http://www.sucaricatura.com/2002/maxi/2002H001.jpg",
    
"http://www.sucaricatura.com/2002/mini/2002H002.jpg",
    
"http://www.sucaricatura.com/2002/maxi/2002H003.jpg",
    
"http://www.sucaricatura.com/2002/mini/2002H004.jpg",
    
"http://www.sucaricatura.com/2002/maxi/2002H005.jpg",
    
"http://www.sucaricatura.com/2002/mini/2002H006.jpg",
    
"http://www.sucaricatura.com/2002/maxi/2002H007.jpg"
];

function 
azar()    {
    var 
temp = new Array(4);
    
temp[0] = Math.floor(Math.random() * imagenes.length);
    do
        
temp[1] = Math.floor(Math.random() * imagenes.length);
    while (
temp[0] == temp[1])
    do
        
temp[2] = Math.floor(Math.random() * imagenes.length);
    while (
temp[0] == temp[1] || temp[0] == temp[2] || temp[1] == temp[2])
    do
        
temp[3] = Math.floor(Math.random() * imagenes.length);
    while (    
temp[0] == temp[1] ||
        
temp[0] == temp[2] ||
        
temp[1] == temp[2] ||
        
temp[0] == temp[3] ||
        
temp[1] == temp[3] ||
        
temp[2] == temp[3]
)
//    alert(temp[0] + ", " + temp[1] + ", " + temp[2] + ", " + temp[3]);
    
document.images.imagen1.src imagenes[temp[0]];
    
document.images.imagen2.src imagenes[temp[1]];
    
document.images.imagen3.src imagenes[temp[2]];
    
document.images.imagen4.src imagenes[temp[3]];
}
</script>
</head>
<body onload=azar()>
<img src="" name=imagen1>
<img src="" name=imagen2>
<img src="" name=imagen3>
<img src="" name=imagen4>
</body> 
</html> 
Si lo pruebas, pon otras imágenes, porque algunas tienen bastante peso.

Saludos