Ver Mensaje Individual
  #8 (permalink)  
Antiguo 06/11/2008, 08:39
Avatar de Fernand0
Fernand0
 
Fecha de Ingreso: septiembre-2005
Ubicación: Buenos Aires
Mensajes: 610
Antigüedad: 19 años, 5 meses
Puntos: 19
Respuesta: Reducir tamaño de imagen dinámica con javascript

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[i].src.match(cond)) {
  7.             iMg[i].style.width='150px'; iMg[i].style.height='120px';
  8.         }
  9.     }
  10. }