Ver Mensaje Individual
  #1 (permalink)  
Antiguo 23/02/2011, 05:29
nachetee
 
Fecha de Ingreso: enero-2011
Mensajes: 84
Antigüedad: 13 años, 4 meses
Puntos: 4
Mostrar número de imagen javascript

Hola soy nuevo en Javascript y tengo la siguiente duda:

Tengo el siguiente código donde muestro una serie de imágenes, pues me gustaría que arriba o debajo de la imagen apareciera el número del a imagen, por ejemplo, 1/15, 2/15, 3/15... ¿alguien sabe como se hace? Muchas gracias de antemano!

Código:
<table border="0" cellpadding="0">
  <tr>
    <td width="100%"><img src="x1.jpg" name="photoslider"></td>
  </tr>
  <tr>
    <td width="100%"><form method="POST" name="rotater">
<script type="text/javascript">
var photos=new Array()
var which=0


photos[0]="x1.jpg"
photos[1]="x2.jpg"
photos[2]="x3.jpg"
photos[3]="x4.jpg"
photos[4]="x5.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><!--webbot
      bot="HTMLMarkup" endspan --><input type="button" value="<<Back" name="B2"
      onClick="backward()"> <input type="button" value="Next>>" name="B1"
      onClick="forward()"><br>
    </td>
  </tr>
</table>