Ver Mensaje Individual
  #7 (permalink)  
Antiguo 06/11/2008, 08:31
jordi45
 
Fecha de Ingreso: octubre-2008
Mensajes: 168
Antigüedad: 16 años, 3 meses
Puntos: 2
Respuesta: Reducir tamaño de imagen dinámica con javascript

Cita:
Iniciado por Fernand0 Ver Mensaje
Código JavaScript:
Ver original
  1. function cambiaTamanio(){
  2. var cond='images/foto/';
  3. var iMg=document.getElementsByTagName('img');
  4.  
  5. for(var i=0; i<iMg.length; ++i) {
  6. if(iMg.src.match(cond)) {
  7. iMg[i].width='150px'; iMg[i].height='120px';
  8. }
  9. }
  10. }

Fijate si esto es lo que queres..
lo he puesto así y no funciona