Ver Mensaje Individual
  #1 (permalink)  
Antiguo 23/03/2012, 12:53
Avatar de mazaku
mazaku
 
Fecha de Ingreso: septiembre-2009
Ubicación: Veracruz
Mensajes: 104
Antigüedad: 14 años, 8 meses
Puntos: 0
Generar array dinamico de imagenes

Buen dia quisiera que me pudieran ayudar porfavor con el siguiente problema tengo este codigo pero quisiera mostrar el array de forma dinamica es decir que haga el array de un directorio donde atraves de una url que le pase por medio de una BD, y no tener que estar poniendo manualmente las imagenes sino que al darle el url del directorio las cree automaticamente.

Código:
<script language="JavaScript1.1">
var photos=new Array()
var which=0

/*Change the below variables to reference your own images. You may have as many images in the slider as you wish*/
photos[0]="immagine01.jpg"
photos[1]="immagine02.jpg"
photos[2]="immagine03.jpg"
photos[3]="immagine04.jpg"
photos[4]="immagine05.jpg"


function backward(){
if (which>0){
window.status=''
which--
document.images.photoslider.src=photos[which]
}
}

function forward(){
if (which<photos.length-1){
which++
document.images.photoslider.src=photos[which]
}
else window.status='End of gallery'
}
</script>
es decir en vez de estar escribiendo manuelmente esto que sea automaticamente

Código Javascript:
Ver original
  1. /*Change the below variables to reference your own images. You may have as many images in the slider as you wish*/
  2. photos[0]="immagine01.jpg"
  3. photos[1]="immagine02.jpg"
  4. photos[2]="immagine03.jpg"
  5. photos[3]="immagine04.jpg"
  6. photos[4]="immagine05.jpg"

espero haberme explicado bien muchas gracias por su ayuda